SRD:Contingent Resurrection

Contingent resurrection returns the subject to life if he or she is slain. Once cast, the spell remains quiescent and does not activate until the trigger conditions have been met (but each day it remains untriggered, it uses up an epic spell slot, even if the character cast it on another creature). Once triggered, the spell is expended. If the subject is killed (the trigger), he or she is restored to life and complete health 1 minute later, so long as even a tiny bit of dust remains for contingent resurrection to act upon. A shaft of light shines down from the heavens, illuminating the subject and everything within 20 feet. The creature is restored to full hit points, vigor, and health, with no loss of prepared spells. However, the subject loses one level (or 1 point of Constitution if the subject was 1st level). Contingent resurrection does not work on a creature that has died of old age.