Ursula Andress was Egyptian royalty until she killed her lover (the high priest of Isis) when she caught him cheating on her. Forced into exile with her entourage, she discovered a rarely occurring magical flame that gave her immortality. She founded the city of Kuma, enslaved a local tribe, and resolved to wait for the reincarnation of her lover.
Two thousand years later, John Richardson, who is a dead ringer for the high priest, is lured to Kuma. Ursula takes John into the magical flame when it turns blue, so as to give him immortality. We then learn that a second exposure takes away what it gives, and she dies. John Richardson resolves to wait until the flame turns blue again, so that he can enter and die.
Thanks Don P.!