The story opens with a girl named Teresa watching her friend Thomas undergo a surgery that will wipe away any memory of her and the work they've done together. They are volunteers for WICKED — a government agency dedicated to finding a cure for the Flare, a disease that is ravaging humankind. As Teresa contemplates the sacrifice she, Thomas and her friends are making in order to help the human race survive, the story shifts to 13 years earlier.
The entire world has been decimated by solar flares. Sixteen-year-old Mark is riding the subway home from school with his neighbor Trina when the flares strike. New York City becomes a war zone. Those that survive the initial wave of destruction from the intense heat and radiation have to fight other survivors for food. Mark and Trina join with Alec (a former soldier), Lana (a woman he used to work with) and several other teenagers as a way to protect themselves. Members of this ragtag band eventually make their way to the mountains. They meet other survivors and start a community in the wilderness.
One day, as the group prepares to forage for food, they hear the sound of engines overhead, something they hadn't heard in more than a year. A Berg, a kind of airship, flies over the camp. Doors open and men with guns and medical suits start shooting at the people in the mountain community. Mark realizes they're shooting some kind of darts. When people are hit, they immediately fall unconscious.
Mark and Alec manage to escape the chaos and follow the Berg, eventually overpowering its guards. Once onboard the flying ship, they discover medical boxes containing a highly contagious virus. The pilot crashes the airship, and Mark hits his head. He slips into a memory about the first day of the solar flares and how he and Trina navigated the subway tunnels together to find a way out.
When Mark wakes up, he and Alec trek back to their settlement. It takes them two days to find their way through the woods. When they return, they discover that those hit by the darts have either died or are dying from a violent disease. One of their friends, Darnell, has locked himself in a shelter. Mark is heartsick to hear his friend crying out through the walls that his head hurts. As Mark tries to comfort the other teen, Darnell lets out a bloodcurdling scream. His body convulses. The boy then continuously knocks his head against the wall, trying to relieve the pain. Mark leaves when he knows his friend has either fallen unconscious or died.
Mark and Alec find their other friends. Lana and Trina seem unaffected, as does a boy nicknamed Toad. Another girl named Misty, however, complains of a headache. They know Misty is infected with the disease, but Toad refuses to leave her behind. The others tell him which direction they'll be going so he can catch up to them when the inevitable happens.
That night, as they sleep in the woods, Mark dreams again of being in the tunnels of New York City. This time, he remembers how a gang of homeless men attacked them. Alec came to their rescue and incapacitated the men before they could kill the teens.
In the morning, the group continues to look for the settlement from which the Berg came. The following night, Toad catches up to them, but it's obvious that he's now infected. He complains that there are things living in his head that made him kill Misty. Now they are attacking him. He begins to shriek. Alec takes Toad into the woods and kills him. The next afternoon, they come upon another village. The disease has destroyed its inhabitants. A 4-year-old girl named Deedee survived, even though she'd been hit directly by a dart. Her parents died, and the others in her village left her behind. Mark and his friends take care of her.
That night Mark dreams again of meeting Alec in the subway tunnels. Alec insists they must get out before the tunnels are flooded. Mark and Trina aren't sure why Alec thinks there's a tsunami coming, but they follow him because they know he'll keep them safe. Alec leads them to Lana, an old friend of his. They meet Darnell, Misty and Toad — teenagers about Mark's age or a few years older. Another boy, Baxter, is 13. They make their way through the tunnels to the Lincoln Building where they hope to find food, shelter and time to make a plan for the future. They fight off a gang of thugs. Mark wakes as water begins to fill the tunnels.
The next evening, the group hears singing in the forest. Deedee knows it's the people from her village. After the virus struck, they started worshiping trees and animals as being magical. They said Deedee was evil because the virus didn't hurt her. Mark and Alec set out to investigate and find several people dancing around a bonfire. The people capture Mark and Alec, who they believe are demons. Their leader, a man Deedee warned them about, stops the others from killing them. The leader starts to cry out that the demons are killing him as blood drips from his nose and mouth. Mark and Alec flee to the woods as the others start to attack them.
A forest fire erupts, making it difficult for them to return to their own camp. They finally make it back to camp in the morning, but the girls are gone. Mark and Alec follow their trail to a bunker where they believe the people who created the virus reside.
Inside the bunker they find a man who tells them about the disease. They learn it's called "the Flare." The disease was supposed to be a controlled way to kill some of the population so that the remaining natural resources could be used for the survivors. But the virus immediately mutated and became impossible to control. The man tells them that Deedee was given back to the savages in the forest in order to keep them calm.
Others inside the bunker are planning to go to Asheville to confront those in charge and hopefully find an antidote. The man is certain that they won't find anything there. The others in the bunker, all of whom are infected, will find a way to use the Flat Trans, a kind of teleportation device, to go to Alaska where all the world's governments have set up a coalition. If the infected get to Alaska, the disease will spread throughout the world.
After a short rest, Mark and Alec spy on the group in the bunker planning to attack Asheville. The leader spots them and orders others to capture Mark and Alec. After a violent escape from the bunker, Mark and Alec manage to steal a Berg that they then use to search for Trina and Lana. As Mark battles several assailants hidden on the Berg, he finds himself consumed by rage. The irrational behavior makes him scared that he's succumbing to the Flare.
In the short rests that Mark takes, he dreams of a horrendous tsunami that fills the subway tunnels, drowning hundreds of people. Alec leads his group to the Lincoln Building where they recoup from their ordeal, gathering food from abandoned vending machines and getting much needed rest. Sometime later, the sight of a boat traveling down the flooded streets surprises them. A man and a woman break into the Lincoln Building and hold the group hostage with machine guns. To prove they are serious, they shoot the young teen Baxter in cold blood. The others are forced to help the pair gather supplies. Before they can leave, Alec and Lana turn the tables and disarm the pair. Then they steal the boat.
Back in the Berg, Alec and Mark discover a box filled with Transvices, gun-like weapons that dissolve people into air. Armed with the deadly weapons, Alec and Mark set the Berg down in a neighborhood abandoned to victims of the Flare. Earlier, Alec had seen their friends being taken into one of the houses. The scene they encounter is horrific. People scream at nothing, others dance around as if drunk. A group of people seems to be tearing apart another human being for food. Alec and Mark cautiously seek their friends. They come across Lana being dragged from a house by three men. It's obvious she's been badly beaten. One of the men stabs her. Mark and Alec attack them. In the end, Alec must use his Transvice on the attackers. He also uses it to end Lana's suffering.
The two enter the house from which Lana was dragged. They must use the Transvices to evaporate the infected. In the basement, they discover Trina and Deedee, beaten and bloody. Trina has been infected with the Flare and no longer recognizes her friends. The mob in the house attacks them as they try to escape. After another violent battle, the four manage to break free of the house and flee to the Berg. As they travel to Asheville, Mark discovers letters in which the decision to infect part of the population with the Flare is laid out. Mark falls into an exhausted sleep and dreams of a happier time with Trina. When he wakes up, Alec tells him that he has the Flare. He needs to die, but wants his death to mean something. Alec manages to fly the Berg to Asheville, while Mark must fight Flare-infected stowaways. With all of them infected but Deedee, they land in the city. Mark, Trina and Deedee find the building that houses the Flat Trans to Alaska. Mark gives Deedee a note explaining that she's immune to the Flare and may hold the key to finding a cure. He pushes her through the Flat Trans as Flare-infected people attack the building. Mark and Trina kiss goodbye. Just before Alec drives the Berg into the building, destroying the Flat Trans and killing the people inside, Trina whispers Mark's name.
Two years later, government workers take a young boy from his mother. She knows that he has the chance to save the world, but her heart breaks, knowing she will never see him again. As the officials take her son, they decide to rename him Thomas.