Apophis is the overarching main villain of The Kane Chronicles book series by Rick Riordan. He is a destructive supernatural serpent who embodies Chaos, the evil counterpart of Ma'at (order).
The Red Pyramid
Much of Apophis' backstory is revealed in the first book. Since the beginning of time, Apophis was Ra's enemy. Every night, when Ra sailed through the Duat, he and his lieutenants would battle Apophis, driving him off every time. Apophis was eventually imprisoned in a prison in the Duat, but not before the Egyptian priests foretold that he would one day devour the sun and plunge the world into eternal darkness.
At the end of the novel, it is revealed that Apophis had possessed Set's minions, Face of Horror. Apophis, through Face of Horror, had given Set the idea to build the red pyramid and generate enough Chaos energy to level North America. This would have given Apophis enough energy to escape his prison and leave the Duat.
While reading the spell to defeat Set, Sadie realizes Apophis' motives and reveals this to Carter and Set. The red pyramid is destroyed, and Face of Horror is killed.
The Throne of Fire
In the second book, Apophis is still trying to rise from the Duat. Carter and Sadie propose that the only way to stop him is to bring back Ra from his deep slumber, so that he can fight Apophis.
During the story, it is revealed that Apophis had targeted Zia Rashid's home village when she was a child, destroying it in an attempt to kill her.
Towards the end of the book, Vladimir Menshikov comes to Apophis' prison and begins to free him. Carter, Sadie, and Desjardins show up to stop Menshikov and awaken the final aspect of Ra. Menshikov is defeated during the battle, but Apophis possesses his body and advances on Ra. Apophis tries to taunt Ra into fighting him and dying in the process, but Ra makes a comment about "weasel cookies." Confused, Apophis falters long enough for Desjardins to come to his senses and attack him once more. Desjardins performs an execration spell on Apophis, casting him deeper into the Duat and delaying his rise.
The Serpent's Shadow
In the third book, Apophis has regained his strength and has set the fall equinox as the date for his rise. Carter and Sadie try to seek out the copies of the Book of Overcoming Apophis, but Apophis destroys them all. The Kanes find the last copy in Dallas, Texas, but Apophis possesses the magical artifacts guarding the scroll, which attack the Kanes and destroy the scroll.
During the course of the story, Carter and Sadie propose a way to defeat Apophis for good: they will find Apophis' sheut (or shadow, which is a part of his soul), bond it with a statue of Apophis, and perform an execration spell on him. Destroying a part of Apophis' soul will exile him beyond the void, preventing him from ever rising again.
When Carter and Walt assist in defending Thoth's pyramid, Apophis possesses Face of Horror once again and strangles Carter. Apophis offers a bargain to Carter to give up on trying to figure out the shadow execration spell, with Apophis sparing him and his family in return. Before he can do further damage, Thoth kills Face of Horror and cuts off Apophis.
On the fall equinox, Apophis rises on the land of Egypt while Sarah Jacobi and Kwai (who have secretly been taking orders from Apophis) attack the First Nome. Ra, Bast, Bes, and Sobek battle Apophis while Carter and Sadie defeat the magician rebels.
To fight Apophis, Carter calls upon the help of every magician and god there is. The combined army battles many of Apophis' manifestations, which he has created to decieve and divide the gods and magicians. When Carter and Sadie eventually find Apophis' true form, he devours Ra and Zia. Bast and Bes keep Apophis busy while Carter and Sadie read the shadow execration spell and execrate Apophis for good. Right before his death, Apophis reminds Carter and Sadie that when he dies, the gods will have to retreat into the heavens. However, Apophis will never be able to rise again.