So, the penalties that are applied when two characters are in darkness, attacking each other, are perfectly clear in the Pathfinder rules:
In an area of dim light, a character can see somewhat. Creatures within this area have concealment (20% miss chance in combat) from those without darkvision or the ability to see in darkness.
In areas of darkness, creatures without darkvision are effectively blinded. In addition to the obvious effects, a blinded creature has a 50% miss chance in combat (all opponents have total concealment), loses any Dexterity bonus to AC, takes a –2 penalty to AC, and takes a –4 penalty on Perception checks that rely on sight and most Strength- and Dexterity-based skill checks.
Clearly, two enemies in the same light level are going to have a miss chance and possibly no dex bonus and a penalty to AC.
Where the problem comes in is when there are two enemies in different light levels attacking eachother. In the following situations, who gets what penalty?
Xylitol, a wizard in bright light, is firing a scorching ray at Aspartame, a wizard in dim light. Aspartame fires a scorching ray back at Xylitol. By RAW, which wizard(s) get a 20% miss chance?
Aspartame casts deeper darkness, placing himself in darkness. Xylitol and Aspartame fire more scorching rays at each other. By RAW, which wizard(s) have a 50% miss chance, and which one(s) lose their Dex bonus to AC, take -2 to AC, and -4 to Perception checks?