Five days remain until the spring equinox when Apophis, the snake-like force of Chaos, will escape his prison, devour the sun and destroy all of human civilization. Only Ra, the absentee sun god, has the power to stop him. But first Ra must be woken by the teenage Kane siblings, Sadie and Carter, and their new trainees in magic, Jaz and Walt. They begin a globe-trotting quest to find the three scrolls of the Book of Ra, which contain the spells needed to wake him from his sleep.
The first scroll is hidden inside a statue in the Brooklyn Museum. The foursome sneaks past mortal alarm systems, magical wards and a late-night wedding to retrieve the scroll. Their cover is blown when the scroll bursts into flames, a griffin escapes from a frieze and evil spirits attack the wedding guests. Jaz imprisons the spirits in the Duat (a supernatural world that exists beneath the physical world) but uses too much magic and slips into a coma. One of the spirits tells Carter that his friend Zia will die if he continues the quest. Zia is a magician from the House of Life, which is an ancient society that dates to the time of the pharaohs.
The griffin is friendly and pulls the four friends onto a flying boat to reach Brooklyn House, an invisible mansion on the top of a factory. More trainees wait for them there. That night as she sleeps, Sadie's ba (soul) leaves her body and travels through the Duat to the Hall of Ages, the House of Life's headquarters located under the Cairo Airport. She sees Desjardins, the Chief Lector of the House of Life, discussing a plot to destroy Brooklyn House with a man named Vladimir Menshikov. Desjardins appears reluctant, as though he is under a spell. When Menshikov takes off his sunglasses, Sadie sees that his eyes are horribly scarred.
She wakes up (her ba reunited with her body) to find her Uncle Amos sitting at the foot of her bed. He is fully recovered from being possessed by Set, the god of chaos and desert storms (in the adventures that occurred in The Red Pyramid, the first book in the series). Carter's ba meets with the god Horus, who warns him that the gods might attack him if he tries to wake Ra.
With only four days until the equinox, Bast, the cat goddess, goes to check that Apophis' prison is still secure. It's Sadie's birthday, however, and she decides to go to London to visit her friends Liz and Emma. Her timing is unfortunate, as her grandparents have been possessed by the baboon god and the vulture goddess, respectively. They chase the three girls through London. Hoping for assistance, Sadie stops for a brief rendezvous with Anubis, the jackal-headed god, in a medieval graveyard. He gives her a ceremonial knife and tells her that Menshikov keeps the second scroll in the top drawer of his desk in St. Petersburg, Russia. However, Anubis is unable to manifest outside places of death and can't help them escape. Rescue finally comes in the unlikely form of Bes, a limousine-driving dwarf god. Bes is so ugly that he makes gods and monsters explode by dressing in a blue Speedo, making a face and shouting, "Boo!"
Carter and Walt are back at Brooklyn House. Carter, worried about Zia, secretly uses a scrying bowl to determine her whereabouts. When Walt suddenly enters the room, Carter scries Sadie instead. The oil in the bowl catches fire, and Carter realizes Sadie's trip to London has gone horribly wrong. Carter and Walt open a portal to London but arrive after Sadie has been rescued by Bes. Walt returns to Brooklyn House under mysterious circumstances. Bes accompanies Sadie and Carter to the Hermitage Museum in St. Petersburg.
Sadie and Carter leave Bes outside and enter the museum. They find the desk in the same room as Menshikov, who is summoning Set and trapping him in a large green vase. Sadie and Carter steal the scroll and are about to leave when Set informs Menshikov of their presence. Menshikov unleashes a four-legged, two-headed, poisonous snake that mortally wounds Carter before Sadie blasts it to dust. Sadie and Carter are no match for Menshikov's magic, so as a last-ditch effort, the Kanes release Set from the vase.
Set buries Menshikov in red sand and drops a pot on his head, buying Carter and Sadie time. He also tells Sadie the location of the third scroll and the name of Zia's home village. In exchange, Sadie releases the control she had over him when she learned his secret name in The Red Pyramid. Sadie heals Carter using his secret name and a wax figurine that Jaz gave her before becoming comatose. Carter decides to find Zia; he and Sadie separate. Bes escorts Carter to Zia's home village, and Walt arrives from Brooklyn House to help Sadie battle for the third scroll in the Valley of Golden Mummies.
Bes and Carter find Zia's village destroyed and deserted in the middle of the desert. They fight water demons and open the tomb where Zia lies with Ra's crook. Zia flails in an induced sleep in a sarcophagus made of water. Although she is protected as long as she remains in the sarcophagus, she appears to be having nightmares, and Carter decides to wake her. Zia has no memories of the adventures her shabti (animated clay or wax figures that can appear to be real humans or animals) had with Carter in The Red Pyramid. She attacks Carter, believing him to be a traitor. Desjardins and Menshikov arrive in a flash of light. They cage Bes and decide to execute Carter.
While Menshikov, Desjardins, Carter and Bes are fighting, Zia senses that Menshikov is evil. She protests when he tries to turn Carter into a snake. Just in time to prevent Carter from his sad, reptilian fate, Sadie and Walt open a portal under Bes' cage. Bes escapes and shouts, "Boo!" temporarily disintegrating Menshikov and Desjardins. Zia passes out, and the Kanes take her with them to Cairo. When Zia wakes up in the Kanes' hotel room, she tries to escape. Sadie calms Zia down and persuades her to join forces with the Kanes.
Sadie and Walt ride a pair of magical camels across the desert in search of the third scroll. While attempting to open a secret entrance to a famous archaeological dig site, they accidentally remove the entire roof of a subterranean chamber that houses thousands of angry Roman mummies. Because they were improperly mummified, the mummies' bas cannot move into the afterlife but remain tethered to their bodies. Sadie and Walt find the third scroll in the oldest section of the catacombs, but when the mummies learn that Sadie and Carter have Anubis' knife — which has the power to release their bas into the afterlife — they attack. An army of rats eats the mummies before they have a chance to do any serious damage. Sadie learns that Walt suffers from a hereditary curse and is dying.
After the rats eat the mummies, Walt and Sadie create a portal that links the top of the great pyramid to Bes' cage. Bes creates explosions, and Carter fights using Horus' glowing avatar. They temporarily defeat Menshikov and Desjardins, who return to the Hall of Ages to assemble the demonic task force assigned to destroy Brooklyn House. Zia joins forces with the Kanes, and she and Walt leave to defend Brooklyn House from the coming onslaught while Sadie and Carter climb into Ra's dilapidated boat and travel deep into the Duat to retrace Ra's journey along the River of Night.
On the way, they encounter a giant man with horns, who threatens to cut them up. He is one of three aspects of Ra's soul. They read to him from the first scroll of Ra, and he allows them to pass. After the Kanes write hieroglyphs on each other's foreheads to magically shield them from fire, they travel through a Lake of Fire that makes their boat as good as new. Bes joins them partway through their journey at the Fourth House, a special care facility for elderly, forgotten minor gods. A hippopotamus nurse, a fertility goddess who shares a turbulent romantic history with Bes, runs the facility. By reading from the second scroll, Carter and Sadie find Ra and wake him by touching Anubis' ceremonial knife to his lips. He is old, feeble, almost blind and mentally unstable — he seems unaware of his surroundings and constantly speaks gibberish about zebras and weasels.
Despite running well behind time, the Kanes continue down the River of Night until they reach the Seventh House. Their dead parents encourage them to continue their quest and prepare an unorthodox feast of birthday cake and pizza. In order to finish their journey in time to save the world, Carter, Sadie and Bes play a game of senet with the moon god, gambling their rens (secret names) for three extra hours of moonlight. They successfully earn three hours, but the moon god consumes Bes' ren.
Angry at the loss of Bes' ren, the Kanes resume their journey and slay the remaining monsters without thought or effort. Just before dawn, the river plunges deep into the Duat to the pit where Apophis is imprisoned. Menshikov, burned from following the Kanes through the Lake of Fire without magical protection, challenges them to a duel. Carter transforms into a 15-foot, hawk-headed warrior dressed in Horus' battle armor. Sadie fights in the form of a giant kite. Sadie reads the third scroll to wake the third part of Ra's soul, who takes the form of a golden scarab that is swallowed by Ra as soon as he sees it.
Apophis possesses Menshikov. Carter hits him in the head with a shovel and encases him in a glass sarcophagus. Menshikov quickly escapes, but Desjardins, freed from his spell, forfeits his own life to trap Apophis even deeper in the Duat.
Dawn approaches, and the Kanes see Brooklyn House being attacked by demons, evil magicians, monsters and flying snakes. Carter and Sadie help defend it while Bast escorts a still incoherent Ra to his place in the sky — but not before he regurgitates the golden scarab and gives it to Zia. Walt realizes that Ra was talking about Zia (zebra) and Walt (weasel). Jaz, feeling the power of Ra, wakes from her coma, but Walt remains cursed.
After winning the battle, the Kanes give the enemy magicians the option to join them and learn the path of the gods. Some accept; others flee. Amos becomes the new Chief Lector. Because Apophis' defeat is only temporary, Sadie and Carter must work harder than ever to unite all magicians. The gods reluctantly acknowledge Sadie and Carter's victory and pledge to fight beside them in the coming war against the forces of Chaos, but they threaten the Kanes with death if Apophis triumphs. Bes is left in the care of the hippopotamus nurse, who gently cares for his soulless body.