In Egyptian mythology, Apep (also spelled Apepi, and Aapep, or Apophis in Greek) was an evil god, the deification of darkness and chaos (zft in Egyptian), and thus opponent of light and Ma’at (order/truth), whose existence was believed from the 8th Dynasty (mentioned at Moalla) onwards. His name is reconstructed by Egyptologists as *App, as it was written pp(y) and survived in later Coptic as Aphph.
Tales of Apep’s battles against Ra were elaborated during the New Kingdom. Since nearly everyone can see that the sun is not attacked by a giant snake during the day, every day, storytellers said that Apep must lie just below the horizon. This appropriately made him a part of the underworld. In some stories Apep waited for Ra in a western mountain called Bakhu, where the sun set, and in others Apep lurked just before dawn, in the Tenth region of the Night. The wide range of Apep’s possible location gained him the title World Encircler. It was thought that his terrifying roar would cause the underworld to rumble. Myths sometimes say that Apep was trapped there, because he had been the previous chief god and suffered a coup d’etat by Ra, or because he was evil and had been imprisoned.
In his battles, Apep was thought to use a magical gaze to hypnotize Ra and his entourage, attempting to devour them whilst choking the river on which they travelled through the underworld with his coils. Sometimes Apep had assistance from other demons, named Sek and Mot. Ra was assisted by a number of defenders who travelled with him, the most powerful being Set, who sat at the helm.
In a bid to explain certain natural phenomena it was said that occasionally Apep got the upper hand. The damage to order caused thunderstorms and earthquakes. Indeed: it was even thought that sometimes Apep actually managed to swallow Ra during the day, causing a solar eclipse, but since Ra’s defenders quickly cut him free of Apep, the eclipse always ended within a few minutes. On the occasions when Apep was said to have been killed, he was able to return each night (since he lived in the world of the dead already). In Atenism it is Aten who kills the monster since Aten is the only god in the belief system.
However, in other myths, it was the cat goddess Bast, daughter of Ra, who slew Apep in her cat form one night, hunting him down with her all seeing eye. //wikipedia