Suppose a divine caster is casting a spell that targets "Allies in a 20-ft.-radius burst". And suppose that unbeknownst to the caster, someone she thinks is an ally is actually an enemy. Does the spell target that false-friend, or not?
I specified a divine caster because I imagine that even if the caster doesn't know the traitor is actually an enemy, her deity probably does.
So, does the caster "choose" the targets according to who she thinks her allies are, or does the deity providing the spell "choose" the targets according to what he knows about who her allies truly are or are not.
I can think of some interesting roleplaying if a character happened to find out about a traitor in that way, but it probably makes it "too easy" to figure out who your friends are.
Do the core materials specify anywhere how it is determined who is an ally and who is an enemy for the purposes of spell targeting?