Set thirteen years before the events of The Maze Runner, the novel chronologically begins in New York City when the world is hit by solar flares. Mark and Trina form an alliance with Alec, Lana and others who rescue them from a group of street urchins. The group flees to the Lincoln building to avoid an impending tsunami, and most manage to survive although some of their group are lost along the way. They camp out in the building for weeks until a yacht arrives and the ship's crew takes them hostage and kills one of them. Alec manages to take out their captors and they take the yacht as their own. Then they pilot the boat to the Appalachian Beaches.
The beginning of the novel takes place in North Carolina one year later, when the small village where Mark, Trina, Alec and Lana live is attacked by huge helicopter-like vehicles, known as Bergs. The crew of the Berg shower them with darts, killing many villagers. Mark and Alec manage to subdue and take over a Berg but the pilot crashes it to avoid answering any question. Mark and Alec realize that the darts were filled with a deadly virus and take Lana and Trina to find the headquarters of the mysterious attackers. The group encounters an abandoned village where they meet a 5 year-old girl named Deedee, whom they take with them. Mark and Alec leave the group for a while to investigate a loud noise. They encounter an infected cult who believe Deedee is a demon of some sort as she is not affected by the virus within the darts. They manage to escape the cult, but they realize that a forest fire has been started and that Trina, Deedee and Lana are gone from the campsite. They continue their trek to the headquarters site, thinking that the three girls are there.
They arrive at the site and sneak in to what appears to be the Post-Flares Coalition's (PFC) base. They eavesdrop on a convention and realize that the virus is widely known as The Flare, a virus that shuts down the thinking-part of people's brains. They also learn that the girls were given back to the cult. They are caught eavesdropping and manage to escape and steal a Berg, before Mark realizes that The Flare has already taken his mind. Inside the Berg, Mark and Alec find a Transvice, a gun that evaporates people's molecules. They recharge it in order to use it to battle the infected.
Their journey inside the Berg takes them near Asheville, where they find Lana. Lana was badly tortured by the infected, forcing Alec to kill her using the Transvice to end her suffering. They find Trina and Deedee at an old house, where Mark realizes Trina has the Flare and has forgotten about him. They are attacked by the infected and manage to escape back to the Berg. As Mark starts to lose his mind, he realizes that Deedee is immune to the virus and should be sent to the PFC base in Alaska. Mark plans on delivering Deedee using a Flat Trans teleporter in another base inside the safe part of Asheville. As they travel, it is revealed that Alec also has the Flare and is dying.
Mark and Trina manage to deliver Deedee to the Flat Trans, sending her to the safety of the PFC base. Mark orders Alec to crash the Berg into the building, in order to prevent the infected from escaping Asheville. Trina remembers Mark and they embrace just as the Berg crashes, killing everyone in the base.
In the epilogue, two years later, a woman's son is taken away from her by authorities from W.I.C.K.E.D., as he is immune to the virus. The employees name him Thomas. Deedee has been renamed Teresa and is arranged by W.I.C.K.E.D. to meet Thomas, as they will help begin setting up the maze.
In the prologue, taking place eleven years later, Thomas is ordered to get the Swipe and is put in The Box, as he is one of the candidates needed inside. Thomas is then sent to the maze, setting the events of The Maze Runner in motion.