After learning that Apophis is rising, Carter and Sadie become determined to revive Ra, the only god powerful enough to face him. In order to do so, the Kanes and their friends search for and locate the Book of Ra and learn from it that they need to follow Ra's nightly journey through the Twelve Houses of the Night in order to find and revive Ra. At sunset on the spring equinox, the only time to revive Ra until the fall equinox six months later, Carter and Sadie travel into the Duat to attempt to revive Ra. They find Ra's sun boat in bad shape at a dock in the Duat and Babi and Nekhbet guarding it in an attempt to dissuade them from attempting their task. Carter is able to scare them using Ra's crook and flail and force them to swear allegiance to Ra before sending them away.
Carter and Sadie board Ra's boat and are dismayed to find it in terrible shape as it hasn't done its nightly journey in thousands of years and thus hasn't had the chance to renew itself. They set sail, but have a hard time controlling the boat until its crew lights appear, angry at Sadie as she is the former host of Isis, the person who forced Ra to retire. Sadie is able to convince the crew to help them as they are trying to bring Ra back and they man their stations. The boat sails down the River of Night through the first three Houses of the Night with Carter bailing the boat out as best he can as it is very leaky. During the journey, Sadie tries to figure out such clues as "first from Chaos," "breath into clay," "the night's flock," "reborn in fire," "the acres of the sun," "the kiss of the knife," "the gambler of light" and "the last scarab" and was only able to figure out that as they passed through the Twelve Houses she'd have to read from the Book at three different locations to revive Ra's three different aspects, but would die if she failed in her task. When they reach the entrance to the Fourth House of the Night, Carter and Sadie encounter Khnum Ra's first aspect who they have to correctly name the secret name of in order to pass or die. Khnum reveals he has been there so long he has forgotten his own name, but believes he will know it when he hears it. Talking to Khnum causes Sadie to realize Ra is important as he is the original source of Ma'at and if Apophis rises so must he. Realizing that the first part of the Book was describing Khnum's name, Sadie reads the first part of the spell to awaken Ra, naming Khnum. It works and Khnum dissolves and is absorbed by the Book, but warns them to beware of what is ahead and that the next aspect of Ra might not be happy to be awoken. With Khnum gone, the boat is able to continue its journey into the Fourth House of the Night.
Fourth House of Night
As the boat continues into the Fourth House, Carter and Sadie notice that it is starting to grow hotter and that they are heading off a waterfall into the Lake of Fire. Knowing that they won't survive the fire, Carter tries to get the orb crew to turn the boat around, but they refuse. However, Sadie realizes that the "reborn in fire" in the Book refers to the boat sailing through the Lake of Fire and being renewed as it is part of Ra's nightly journey and that if they want to revive Ra, they must go through the fire as well. In order for them to survive, Sadie paints the hieroglyphs for fire and shield on Carter and herself, creating a fire shield around them, however, as she did hers quickly, Sadie's shield is weak and they are forced to hold their breaths. The boat plunges into the fire and though Sadie's weak shield nearly collapses, Carter grabs her hand and shares his energy with her, keeping it up long enough for them to emerge from the fire. Carter and Sadie survive and the sun boat is renewed back to its original state. They then dock at Sunny Acres, also known as the House of Rest where they reunite with Bes. However, they spot a boat with Vladimir Menshikov in it and realize that they are being closely followed by their enemy. Carter, Sadie and Bes enter the House to look for Ra and encounter Bes' old girlfriend Tawaret who agrees to help but warns that they don't have much time as they are now in the fifth hour of the night and they must pass the gates of the Eighth House during the eighth hour or they will be trapped in the Duat until the gates open the next night. Believing that Ra might be a falcon-headed god she once saw, Tawaret leads Carter, Sadie and Bes to seek out the god with no luck and Sadie realizes that they need to start the second part of the spell in order to find Ra. Reading the spell causes a cloud of grey smoke to appear and lead them to Ra's room where he is sleeping as a very old man. Reaching the end of the spell, Sadie realizes that in order to awaken Ra she needs the netjeri blade Anubis gave her and as she completes the spell, she touches the blade to Ra's mouth and wakes him. However, Ra wakes senile and talking about zebras and weasels and not even giving him the crook and flail causes him to react. Believing that maybe if they get the last part of Ra's soul he will be reborn, Bes proceeds to carry him through the House back to the boat but in the lobby they find Menshikov's amulet and realize they are too late as the sundial on the front desk points to eight meaning that even if they get through the other Houses of the Night, it will be too late by the time they reach the Eighth House.
A game of senet
Carter and Sadie nearly give up hope, but Tawaret and Horus insist they continue on with Tawaret suggesting that they might find help from their father in the Seventh House which is the house of Osiris. Boarding the sun boat, Ra's presence causes the throne of fire to reappear on board and they travel to the Seventh House where they are reunited with their parents. Julius and Ruby summon the moon god Khonsu to offer a solution: if they can beat Khonsu in a game of senet, they can get three extra hours in the night which will cause the gates of the Eighth House to still be open and allow them to pass by. For this they need three players and for every piece of theirs that they get off the board, they gain one hour of time, but for every piece Khonsu gets off the board, he gets one of their rens. With Bes joining them as the third player, they agree, but their parents leave, unable to watch or participate in the game. With Sadie and Bes playing and Carter mostly just moving the pieces, they are able to get one of their pieces off the board and get one hour, but Khonsu also gets a piece off and demands one of their rens. While Carter prepares to sacrifice himself, Bes decides to instead and disappears when his ren is consumed. Angry at this, Carter and Sadie quickly win the game and gain the three needed hours and along with Ra, are transported to the sun boat by Khonsu and make it through the gates of the Eighth House just in time.
Confrontation in Apophis' cavern
Carter and Sadie make it through most of the remaining Houses of the Night without issue, but as they approach the exit to the mortal world in the Twelfth House, they find that Menshikov has created a giant crater in the River that drops them into a cavern with millions of dead scarab shells, dozens of demons, a giant serpentine shape moving under the shells and Menshikov: Apophis' prison. Menshikov is pleased as with the senile Ra there, when Apophis rises he will be able to devour Ra and Ra will be too weak to fight back. Horus urges Carter to take up the crook and flail again and fight Apophis, but Carter refuses and instead summons his combat avatar which becomes physical that deep into the Duat. As Menshikov tries to attack, Sadie transforms her staff into a giant kite which blows Menshikov and his demons back and Sadie asks Carter to defend her as she casts the spell to summon Ra's last aspect, Khepri. Before she can, Menshikov reveals that the spirit of Khepri created Apophis' prison and his physical form as the scarabs is what is binding Apophis. If she summons the last scarab or the demons find and destroy it, Apophis will be set free and even if the scarab is summoned back to Ra, he is too weak to fight, allowing Apophis to win. Menshikov reveals that the power of Chaos is slowly killing them in the cavern, but he intends to become the host of Apophis which will allow him to survive. To everyone's surprise, Chief Lector Michel Desjardins, who is a friend of Menshikov and an enemy of the Kanes, arrives to help them battle Menshikov despite being severely weakened due to Menshikov draining his energy with curses. Desjardins tells Sadie to begin the spell while he holds off Menshikov, but Menshikov tries to convince Carter and Sadie to merge with Horus and Isis again, kill Desjardins and join him, even offering the secret to curing Walt Stone of his curse if they do so. While they find the offer tempting, they refuse and Desjardins attacks Menshikov while Carter and Sadie's kite battle the demons and prevent them from attacking Sadie or the defenseless Ra. Sadie succeeds in casting the last spell, causing the Book of Ra to vanish and the last scarab to fly to her. However, at the same time, Desjardins is defeated by Menshikov and thrown so hard into the sun boat that he is knocked out and Apophis is released and takes Menshikov as his host, causing all of Menshikov's injuries to heal, Menshikov to start growing red scales and his power to increase. Menshikov demands the last scarab, destroying Sadie's kite when it tries to attack him and offers Sadie her life if she gives it to him. Instead, Sadie distracts Menshikov, allowing Carter to sneak up behind him and hit him with a shovel, knocking him out for a moment and allowing Carter to bury him in sand. Sadie then turns the sand to glass around Menshikov, imprisoning him. The remaining demons then flee, with some falling into the River of Night and dissolving. As Sadie heads to the sun boat to give the scarab to Ra, Menshikov breaks free of his prison, sending a wave of sand and glass that shreds Carter's avatar and buries Sadie in sand. Unable to find her quickly, Apophis, now fully possessing Menshikov, goes after Ra to kill him while Carter is left weakened by the blast and the Chaos energy sapping his life force. Apophis gets distracted when Ra asks for a "weasel cookie" and Desjardins attacks him, fighting with him in front of the throne of fire. They battle with Desjardins summoning the power of Ma'at while Apophis summons Chaos while Carter searches for Sadie. Carter eventually finds and rescues Sadie while Desjardins manages to send Apophis flying with the glyph for "turn back." Desperate to defeat Apophis, Desjardins casts an execration on Apophis using a makeshift shabti of him. Apophis desperately tries to attack Desjardins to stop him, but the spell creates a shield around him that absorbs it all. Finally, using up all of his life force, Desjardins manages to execrate Apophis, causing Menshikov's body to crumble, killing Menshikov and causing a portal to open up that sucks Apophis deeper into the Duat. The whole beach starts to implode so Carter and Sadie quickly return to the sun boat, carrying the collapsed Desjardins with them. They take off as the cavern fills up with water and are returned to the Twelfth House.
Return to the mortal world
Back on track, Carter, Sadie, Desjardins and Ra follow the River of Night back to the mortal world. However, as Desjardins used up all of his life force, he dies, but makes peace with Sadie and Carter, telling them that the execration won't last long and he bought them time so that they could continue teaching the Path of the Gods to people which he has realized is the only way. After Desjardins dies and turns into a cloud of hieroglyphs, Carter and Sadie give Ra the Khepri beetle, but even after he swallows it, he isn't reborn and it appears that all they did was for nothing. At sunrise, the three return to the mortal world which cures them of the Chaos sickness and they spot the fact that their friends are under attack at Brooklyn House and rush there to help. The presence of Ra revitalizes the defenders and they defeat the enemy magicians. Ra returns to the heavens where he becomes pharaoh again, but as he is still senile, the gods aren't happy about it. Ra resumes his nightly journey through the Duat protected by the other gods, but Apophis is only banished for a matter of days to weeks and Ra is in no shape to face him when he rises again. Waking Ra also causes friction between Carter, Sadie, Horus and Isis.
With Ra in his senile state, Carter and Sadie are forced to search for other solutions to the problem of Apophis. Eventually they come up with the plan to use a shadow execration, a variant of the execration spell that uses the being's sheut or shadow instead of just a shabti. Ra remains senile until Zia Rashid allows him to take her as a host after which he is finally reborn. However, Ra doesn't return to his role as leader of the gods, giving that to Carter and Horus and only returns to help battle Apophis. In the end, Ra proves vital in the final battle with Apophis, helping to hold him off long enough for the Kanes to finally destroy him. Bes is rendered basically mindless by loosing his ren. However, while searching for Apophis' sheut, Sadie and Walt Stone are able to use Bes' sheut to restore his ren, restoring him to normal.