At the landing site of the shuttle Ares III, Acidalia Planitia, Mars, at a time in the near future, the crew of the Hermes
— including Commander Melissa Lewis (Jessica Chastain
), botanist Mark Watney (Matt Damon
), IT guru Beth Johanssen (Kate Mara
), pilot Rick Martinez (Michael Peña
), flight surgeon Chris Beck (Sebastian Stan
), and navigator and chemist Alex Vogel (Aksel Hennie
) — are gathering samples before re-entering their living facility, the HAB.
The crew learns that a storm is approaching. The storm's intensity and high winds lead Commander Lewis to order a mission abort. Watney argues for waiting it out and brings up the rear as the crew heads toward the MAV (Mars Ascent Vehicle), the ship that will take them back to the orbiting Hermes
, in their suits. Heavy winds and sand gusts surround them. A satellite dish breaks off and strikes Watney, knocking him out of sight of the rest of the crew. Lewis tries to guide the others to find Watney, but visibility is very poor and the storm is way too strong for them. They head back into the MAV without Watney and lift off. The pilot, Martinez, is barely able to keep the rocket from tipping over.
Back on Earth, NASA Director Teddy Sanders (Jeff Daniels
) holds a press conference to announce that while the Hermes
crew succeeded in leaving Mars, Mark Watney was lost, and he is declared dead.
Watney wakes up on Mars on what is Sol 21 (mission day 21) after the storm has passed. His oxygen is depleting rapidly, so he makes his way back to the habitat station. He's been impaled by part of an antenna, which still protrudes from his abdomen — the combination of the antenna and his own blood sealed the suit just enough to keep most of his air from leaking out. Watney pulls the antenna out, uses forceps to fish out a piece that broke off in the wound, then staples the wound shut.
He sits down to make a video log, where he outlines the situation: he's alive, but he can't contact Earth or Hermes
; it'll be four years before the next manned mission is launched; and with the food supply in the habitat meant for him and the other five crew members, he has almost a year's worth of food, or a little longer if he rations. Therefore, Watney determines that he has to grow three years' worth of food on a planet where nothing grows. Luckily for him, he's a botanist.
At NASA in Houston, Texas, Sanders has just returned from a memorial service for Mark Watney, where he spoke about Watney's dedication to exploration. Mars Mission Director Vincent Kapoor (Chiwetel Ejiofor
) talks to Sanders about getting satellite time to locate Watney's body. Sanders refuses on the grounds that the satellite feeds are public and broadcasting pictures of Watney's corpse would be a political and budgetary disaster for NASA. Later, engineer Mindy Park (Mackenzie Davis
) meets with Kapoor after she discovers evidence of activity in satellite photos of the Ares III site (low-resolution images apparently taken in a routine fly-by): the solar panels have been cleaned and the rover has moved. They bring in Sanders and Director of Media Relations Annie Montrose (Kristen Wiig
) to show them that Watney is still alive.
A few sols (Martian days) later, inside the habitat, Watney has planted potatoes using Martian soil and vacuum-sealed packets of the crew's feces as fertilizer (to his disgust). Needing more water for the potato crop, he burns off hydrazine rocket fuel — a byproduct of the reaction is water. On his first attempt to ignite the hydrazine, he causes a moderate explosion, singeing his clothing and hair. Watney notes that this explosive tendency is the reason that NASA does not use pure hydrogen. As he continues to work on his food supply, he keeps going with the video logs and decides to use a rover to make it to the Schiaparelli crater that will be the landing site for Ares IV in four years. Since the battery-powered rover can't cover the whole distance, he modifies it, adding solar cells and an extra battery. To conserve battery power, the pod of plutonium used to get the crew to Mars in their original spacecraft serves as a heat source in the cabin.
Watney uses the rover to find a Pathfinder probe that stopped transmitting in 1997; he hopes to use it to get in touch with NASA. He digs the old probe out of the sand, spreads its solar panels to charge the batteries, and discovers that it still works.Using hand-written signs for the Pathfinder's camera, he is able to send a message to NASA confirming that he is alive. Kapoor is able to receive the message because he and colleagues at the Jet Propulsion Lab (JPL), who built the Pathfinders, have pulled another Pathfinder out of storage, rounded up the engineers who worked on it, and got it working again. They manage to communicate with Watney, first by panning the Mars Pathfinder's camera to point at 'yes' or 'no' signs when Watney asks if his signal is being received, and then by panning around a hexadecimal clock that Watney has scratched out on the ground around his Pathfinder. NASA uses this system to tell him how to hack the rover's operating system so it can transmit text back to Earth. When Watney, finally able to type his messages chat-style, asks how the Hermes
crew took the news that he wasn't dead, Kapoor regretfully tells him that the crew hasn't been told. Watney responds with obscenities (which are broadcast all over the world).
Watney's story becomes a worldwide sensation. His communications with NASA are logged, and at the request of PR Director Annie Montrose he uses the Pathfinder's camera to take a spacesuited selfie (in a two-thumbs-up Fonzie pose) which Montrose doesn't like because she can't see his face.
Meanwhile, the crew aboard Hermes
has spent the last couple of months quietly flying back toward Earth while keeping in touch with their loved ones. The flight director of Ares III, Mitch Henderson (Sean Bean
), contacts the crew and informs them that Watney is alive, and that NASA has kept it from them for the last two months so as to not distract them from their mission. The news only makes them angry and guilt-ridden, but Henderson tells them that Watney has stressed repeatedly that it wasn't their fault and they had reason to believe that he was dead.
The folks at NASA determine that they can reach Watney by Sol 868. The food he's growing plus the rations in the hab will run out in a bit over 900 days. Sanders frets that the margin of error is too small.
Back on Mars, things begin to go bad for Watney when the habitat's worn-out airlock explosively decompresses, throwing the airlock some distance while he's inside it and causing his helmet to crack and leak. He uses duct tape to seal the cracks and stumbles back to the habitat to discover his potato crop frozen and dead. With less food, he now figures he can last only a little more than 300 Sols, or slightly longer if he rations.
NASA and JPL work overtime and quickly launch a probe to resupply Watney. To make their launch window they bypass routine inspections, and moments after launching, the probe explodes. Meanwhile in China, two directors from the Chinese National Space Administration, Zhu Tao (Chen Shu
) and Guo Ming (Eddy Ko
), witness the explosion and discuss helping NASA by offering their classified booster rocket technology to launch a supply craft. Guo Ming asks Zhu Tao why NASA has not already asked for their help and Zhu Tao reminds him that it is a top secret program that NASA would not have any knowledge of. They decide that in the interests of international scientific co-operation, they will contact NASA and offer their booster rocket.
Rich Purnell (Donald Glover
) an eccentric and absent-minded, but brilliant astrodynamicist, devises a plan to accelerate the returning Hermes
around Earth, gaining a gravitational boost and sending it back to Mars to get Watney. The Chinese rocket will resupply the Hermes
for its extended voyage. Sanders vetoes this plan because it risks the lives of the five Hermes
crewmembers and will extend their mission by hundreds of days, but Henderson secretly sends the plan and Purnell's course calculations to the crew. The crew talks it over; they understand that the surreptitious arrival of the plan means that NASA brass have rejected the idea. They assume that if they go back to Mars, the two military members, Lewis and Martinez, will be court-martialed for mutiny and the three civilians will never be allowed to fly another mission. Lewis calls for a unanimous vote, and they all agree to go back for Watney. Johanssen hacks the Hermes
computers to prevent NASA from taking control and they change course, sending a cryptic message to Houston: "Rich Purnell is a steely-eyed missile man."
Sanders is angry with Henderson, who he assumes sent the plan to Hermes
. Henderson doesn't deny, but will not confirm his actions either. Sanders explains that his priority is for NASA to keep flying, but Congress is very sensitive to public opinion and the bad publicity that would result if Purnell's plan failed would likely reduce NASA's budget for years to come. He asks for Henderson's resignation when the mission is over. Then he's forced to announce that NASA is sending Hermes
back to Mars to rescue Watney.
Seven months pass on Mars. Watney has lost a lot of weight, has grown a lot of facial hair, and his teeth are rotting. He's started losing hope in his survival and rescue. He records a video log asking Commander Lewis to let his parents know of his fate. He packs up the rover and leaves the Ares III site — having spent 461 sols there — and heads for the Ares IV MAV, which was dropped on Mars well head of the Ares IV mission. It's a 3200-kilometer drive across a trackless and inhospitable Martian landscape. He stops every day for 13 hours to sleep and re-charge the rover's batteries with solar panels. During his excursion, he reasons that Mars is legally international waters — that is, it's subject to the law of the sea because it can't be claimed by any country on Earth. As he has not gotten explicit permission from NASA to take the MAV, and cannot get permission until after taking off, commandeering the MAV will make him a space pirate. He would like to be called Captain Blondbeard.
After the Hermes
has swung around Earth and collected the supplies, they travel back to Mars. NASA and the rest of the world watch with anticipation; with 12 minutes' delay, no one on Earth can help by radio. Watney has to shed 5000 kg of weight from the MAV to make it light enough to reach Hermes'
orbit. He jettisons most of the seats, all the navigation and control systems, and replaces the nose-cone airlock with a tarp.
Martinez, flying the MAV by remote control, launches Watney into orbit. The MAV comes up too low to reach the Hermes
spaceship. The crew uses a quickly-made sugar and oxygen explosive to blow the front hatch and cause escaping air to slow the huge ship down so they can match speeds and still get to Watney. Lewis herself decides to use the EVA MMA suit with a tether to reach Watney, but she can't get close enough. Watney punctures the finger of his glove to propel himself toward Lewis with the escaping air jet. ("Like Ironman!" he says gleefully.) He has very little control, so he misses her. However, he runs into the tether, which his momentum causes to wind around himself and Lewis, and the crew is able to reel them in. Lewis announces to NASA that they have Watney, and people all over the world cheer. (Crowds have gathered in Houston, Times Square, Beijing, and elsewhere, anxiously waiting to hear whether the rescue worked.) The crew hugs Watney and jokes about the stench resulting from his lack of showering for many months.
Back on Earth about one year later, Watney begins Day 1 as an instructor to aspiring astronauts. He tells them of his struggle on Mars, confirming that he did in fact grow food using his own shit. He tells them that if things should go south for them, they can either accept their fate or start solving problems, because that's how you survive — by overcoming one problem after another.
During the closing credits, we see the characters years later as they watch the launch of Ares V, in which Martinez is the commander. Kapoor, Montrose, Park, and Sanders watch from NASA along with Guo Ming & Zhu Tau. Henderson is retired and golfing with his son. Lewis watches at home with her husband, while Vogel is at home with his family. Beck and Johanssen have gotten married and watch from the hospital with their new baby.