Underneath the world and beneath the Nile lives the great serpent Apep, God of Chaos. Long ago, the Sun was his, and he greatly desired it back.
The sun belonged to Ra now, and every day he would carry it across the skies on his river boat, bringing light to the people. At night though, he had to pass through the underworld, and every night Apep would attempt to eat then sun. Sometimes he would win, running off with the Sun and casting the world into to darkness. Ra would battle him for its return, always returning triumphantly in the end.
Eventually, after one of these spells of long darkness, Bastet was fed up. Bastet was the goddess of cats, of fire, and the home. But she also had a malignant side, as a deliverer of wrath to evil.
She begged with her father Ra to let her accompany him when he passed through the underworld that night. Ra agreed, and that night there were two gods on the mighty river boat as it passed into the underworld.
As usual, Apep reared up, seeking to devour the sun. But he had not reckoned on cat-headed Bastet and her flint dagger. With a swift cut she took off the serpent's head.
Apep did not die, he was a god after all. But ever after, if he had thoughts of stealing the sun, Bastet would show up with her trusty dagger, and Apep would think twice about commiting the crime.