Thomas is awakened in the middle of the night by Teresa's voice in his head. He's still not sure how it works, but finds comfort in "speaking" with his friend without using words. He and his fellow Gladers have survived the Maze, and now they find themselves ensconced in a warehouse/dormitory. He and the other boys sleep in one area, while Teresa sleeps somewhere else.
When he finally goes back to sleep, Thomas has a memory/dream of being a young boy. His mother is tucking him in at night. She tells him he has been chosen for a purpose. Teresa wakes him from the dream. She is in distress. Then her presence disappears from his mind. As he struggles to come fully conscious, the other boys in the dormitory start yelling. Cranks, zombie-like people covered in sores and scars, pound at the windows and beg to be killed.
The Cranks can't get through the barred windows, but the boys still want to get out of the dormitory and into the common area. When they finally break through the locked door, a new horror awaits. The people who had helped rescue them from the Maze are strung up from the ceiling, dead. Thomas hurries to Teresa's room. A sign outside her door says she is in Group A. It also labels her as "The Betrayer." But Teresa isn't inside. Instead, they find a boy named Aris. He claims to be from the Maze as well, although the others have never seen him. Thomas searches for Teresa, but she's disappeared. Aris relates a story that mimics their own, only instead of being in a maze with all boys, he was the only male in a maze with girls. He could communicate with one of the girls telepathically, but she was murdered before they escaped. Aris and Thomas discover they can communicate with their minds as well. The boys notice that they've been tattooed. Aris says that he is in Group B and is labeled as The Partner. Thomas and his friends are in Group A. Minho is labeled "The Leader," Newt "The Glue." Thomas' tattoo says that he is to be killed by Group B. All of the tattoos label the boys as property of WICKED, World in Catastrophe: Killzone Experiment Department. The boys know WICKED was responsible for the Maze, and now they wonder what else is in store for them.
When they re-enter the common area, they discover the bodies hanging from the ceiling have been removed. Thomas spends a few minutes trying to reach Teresa telepathically, but when he does, she insists she doesn't know him, and threatens to kill him, before disappearing from his thoughts.
After Thomas sleeps, he finds someone has delivered food to the common room. A man now sits behind a force field. The man explains that he is from WICKED. The department exists for one purpose: to save the world from catastrophe. They have unlimited power, resources and technology.
The man warns the boys to never believe what they see because their minds can be manipulated. Everything they experienced in the Maze was part of a research trial, nothing happened without WICKED's forethought and approval, including the murder of Thomas' friend. The boys must now survive the more difficult Phase Two trials.
The man tells them the world has been ravaged by sun flares. A disease called the Flare is decimating the population. Governments of the surviving nations have banded together to form WICKED, and everything they learn from the trials will help the world to survive. He informs the boys that they have all been infected with the Flare. They will begin The Scorch Trials at 6 in the morning. They will have to pass through the Flat Trans at that time. After that, they have to find open air and head north for 100 miles.
If they make it to the safe haven within two weeks, they will be given the cure for the disease. If they don't survive the trial, they will eventually die a horrible death from the disease. The man warns them that this is their only chance of survival. Anyone who doesn't pass through the Flat Trans within the designated period will be executed.
The following morning, a wall of gray appears in the common area. The boys figure it is the Flat Trans. They pass through it, and find themselves in a pitch-black corridor. As they feel their way along, a disembodied voice warns them to turn back now or be sliced. A few moments later, one of the boys shrieks. Thomas can feel the boy thrashing, convulsing. As the screaming gurgles to a stop, Thomas realizes the boy has a ball of metal instead of a head. The ball disengages from the boy's body and rolls down the hall. Another boy is killed and a third wounded before the Gladers find a stairway out of the dark hall. Unfortunately, it leads to a desert of scorching heat and blinding light. They see buildings in the distance and head for them. Two Cranks from the city run out to investigate them. They warn the boys that there are several stages of the Flare. They must quickly learn who is safe, and who will kill them. They also say another group like them has arrived in the Scorch. The others want to kill Thomas and his friends. The newcomers turn and run back toward the town.
As dark falls, a terrible scream is heard. It sounds like a girl being tortured. The shrieks continue through the night. When they finally stop, a girl appears from behind a building. Thomas knows it's Teresa, though she still won't communicate with him. He insists on following her alone into the building. She screams when he tries to touch her. Thomas realizes she's not in control of her body until she suddenly steps forward and kisses him. She struggles to tell him to run away. Quickly.
He promises to find her again. He flees the building without telling the other boys, and runs toward the town. The others follow. He later dreams of Teresa training him to speak telepathically. When he wakes up, a strange powerful storm erupts. Lightning strikes cause boys to explode. Minho is struck, but fortunately, only his clothing catches on fire, which Thomas manages to put out.
The boys straggle into what they realize is an abandoned city and take refuge in one of the buildings. They are met by a man named Jorge, a Crank who still has his sanity. Jorge leads a band of Cranks. When Minho mouths off to him, the Cranks threaten to kill them all. Thomas convinces Jorge to talk with him alone first so he can explain everything.
Thomas tells Jorge all about the Maze and the Scorch Trials. He tells the man that if he, and maybe a few of his Cranks, help the boys to the safe haven, maybe WICKED will give them the cure for the Flare as well. Thomas finally convinces Jorge of the truth, and he and another Crank, Brenda, help the boys escape.
Brenda and Thomas are separated from the others and are attacked by crazed Cranks. Thomas must kill one of them in order to survive. When he sleeps that night, Thomas has another dream in which he remembers hearing two scientists discussing the Maze and the possible betrayal scenario. They agree that the tests are brutal and may crush the kids' psyche, but they are necessary to collect the data they need to save the world. When Thomas goes out into the city the following morning, he sees a sign that tells him that he's the real leader. Brenda tells him the signs are all over the city. It's why Jorge agreed to help the boys escape.
Thomas tells Brenda about Teresa. Brenda is jealous of the connection he obviously has to the other girl. Brenda and Thomas are taken captive by another group of Cranks who force them to swallow a drugged drink. As the drug takes effect, Brenda asks Thomas to kiss her. He refuses, explaining she could never be Teresa.
They wake up as prisoners, tied to chairs. Minho arrives and helps them to escape. They meet up with the other boys and make their way out of the city. One of Thomas' captors finds them. He shoots Thomas in the shoulder. The bullet is rusted and causes Thomas to get an infection.
WICKED break protocol and send a team in to heal him. While he is under their care, he overhears several interesting bits of information. They're sure their interference in the trials won't affect any of their data collecting, as guns were never supposed to be part of the equation. They refer to Thomas as being the best of the viable candidates. There are only four or five candidates left. They let him know they're returning him back to the Scorch because it's what he would have wanted them to do.
Back in the Scorch, Thomas and the Gladers try to figure out what WICKED wants from them. When he goes to sleep that night, Thomas hears Teresa in his head. She warns him that something awful is going to happen. He's going to be hurt and scared, but she won't be able to help him. He has to remember to trust her, even when it looks like he shouldn't.
As the boys travel toward the safety zone the next day, Teresa and the girls from Group B surround them. They take Thomas prisoner, dragging him over the desert and up a mountain pass. That night, the girls tie him to a tree. Teresa has said that they will kill him because of what he did to her. She treats him cruelly, but the other girls seem unsure if they should kill him.
That night, Thomas dreams about the night before he was sent into the Maze. He and Teresa are watching a video of the Maze. They talk about how everyone is dead and wonder whether they've learned enough to train the replacements. All that matters to them now are the patterns and the killzone. When he wakes up, he struggles to make sense of the memory.
Thomas convinces the girls of Group B not to kill him. They tell him that they've been traveling in tunnels through the city. That's why the boys haven't seen them. They were ordered to wait so Teresa could meet with him in the building alone. Her mind was overtaken by something, and she was forced to kiss him. Thomas is sure now that Teresa is The Betrayer and has turned against him.
Later, Teresa and Aris take Thomas aside. Teresa admits that she and Aris can speak telepathically. Aris and Teresa share several kisses. Thomas is hurt by her betrayal. She tells him this has been WICKED's plan all along, and it's either him or them who will survive. They lead him at knife point to a cave where a secret room opens up. Thomas fights not to be placed inside, but Teresa and Aris are too strong.
Before the door closes and he passes out with a concussion, Thomas hears Teresa in his head, thanking him for being their sacrifice. He dreams again of the past, this time, he is saying goodbye to Teresa and Aris just before entering the Maze. It is obvious that Thomas and Teresa have a relationship. Theresa tries to convince Thomas that the plan is going to work. Thomas and Aris enter the Maze together.
Eventually, Teresa and Aris release Thomas from the cell. She tries to convince him that it was all part of the plan and apologizes for having to hurt him. She swears that WICKED told her if she didn't do everything they told her, they would kill Thomas. He can't process his emotions, but he knows he trusts neither of the two. They make their way to the safety zone, where they meet up with the others from both groups.
As the time for the cure to appear approaches, so do several large pods. Creatures crawl out from them and attack the teenagers. As Thomas and the others fight the creatures, another electrical storm hits. A Berg, a kind of air ship, touches down, and the survivors fight their way into the craft. Jorge and Brenda also manage to get on board, but a member of WICKED informs Thomas that only one can stay.
Thomas chooses Jorge, thinking that it's some kind of test and they will actually allow Brenda to stay. But the guard drags Brenda toward the exit. Thomas overpowers him and takes the man's gun, insisting that he and the others have done enough. He doesn't care about trials or killzones anymore. Everyone gets to stay on the Berg. The man smiles and agrees. That had been the true test.
Thomas is separated from the others while he sleeps. When he wakes up, he hears Brenda's voice in his mind, warning him that things are going to get very bad for him again. She, too, is a WICKED plant. Later, Teresa's voice tells him that they've been told he's gone crazy, that the Flare has overtaken his mind.
Thomas begs Teresa to leave him alone. Before she does, she tells him to remember that WICKED is good. A memorandum from WICKED ends the novel. It tells its readers not to let emotions interfere with their work. Things have not gone as planned, but their research will save humanity. The Chancellor is sure that once the Candidates' memories have been restored, they will agree that what was done was for the best. The Chancellor plans on telling the Candidates soon, which ones are, and are not, immune to the Flare.