Similar to how damage reduction is handled any reduction to damage taken will not be applied to the victim until the amount of damage is determined.
Make any saving throws/spell resistance checks to determine amount of damage recieved.
Apply damage reduction to this damage.
Apply damage to hapless victim.
So for example, Bob the Wizard has chill variant fire shield (from an ally) and protection from energy (with 60 points left, 6th level caster) and resist energy (10 points of DR, 6th level caster) and gets breathed on by the mother of all red dragons for 200 damage, this doesn't look nice.
Important quote from protection from energy and resist energy :
Resist energy overlaps (and does not stack with) protection from energy. If a character is warded by protection from energy and resist energy, the protection spell absorbs damage until its power is exhausted.
Bob make a saving throw, if Bob succeeds Bob takes no damage (fire shield) if he fails he takes half damage (fire shield). So let's say Bob fails (So we can continue the example) Bob takes 100 damage.
Bob applies damage reduction; Now protection from energy and resist energy overlap, both spells are active but only one works at once. So until protection from energy is used up that's all the resistance Bob gets.
So in this example Bob is taking 100 damage, reduced by 60 points from the protection from energy leaving 40 points of damage left.
Because Bob has more than 10 points of protection from energy resistance left, nothing is applied from the resist energy. But the next time Bob gets breathed on he'll reduce the damage by 10 each time (after saves).
If Bob had only 5 points of protection from energy resistance left then he'd reduce his damage by 10 as the effects overlap. This is because the resist energy isn't applied until protection from energy runs out as the effects do not stack.
So the end result is: Bob takes 40 damage. Bob decides to get out of here!
One additional quirk of all this, like damage reduction if you absorb all the damage from an effect with Protection from Energy or Fire Shield then no side effects are taken.
However Resist Energy only reduces damage (the spell specifically states this) so you could, say, potentially catch on fire if caught in a burst of flame and are protected by Resist Energy but reduce the damage to zero - this gives you another reason to use the higher level (and better in that respect as well) Protection from Energy