How does The Martian end?
Mark Watney's survival plan shifts from a solo overland trek to Schiaparelli crater toward a far riskier rescue once astrodynamicist Rich Purnell calculates a slingshot trajectory that can send the Hermes back to Mars using Earth's gravity for a much-extended mission. NASA's administrator vetoes the maneuver because of the danger to the rest of the crew, but flight director Mitch Henderson leaks the plan to Hermes anyway, and all five of Watney's crewmates vote unanimously to do it, disabling remote overrides so NASA can't stop them. A resupply probe launched on a Chinese booster docks with Hermes as it swings past Earth, giving the crew the extra supplies needed for the extended trip back to Mars.
Meanwhile Watney resumes converting a rover for the long drive to Schiaparelli, since the new plan requires him to launch in the Ares 4 mission's pre-positioned MAV to meet Hermes on its flyby rather than wait years for rescue. During the modification work he accidentally destroys the Pathfinder probe's electronics, cutting off his two-way communication with Earth; he's reduced to leaving Morse code messages spelled out with rocks. Setting out across the Martian terrain, he spots an approaching dust storm NASA can't warn him about, works out its size and direction from careful observation, and successfully routes around it, later surviving a rover rollover during the descent into Schiaparelli crater.
At the MAV, Watney reestablishes radio contact and receives instructions for drastically lightening the spacecraft so it can reach the intercept altitude and speed needed to meet Hermes — including stripping off the nose cone and covering the opening with Hab canvas. On launch the makeshift canvas cover tears loose, creating drag that leaves him well short of the planned rendezvous trajectory, undershooting Hermes by a significant margin.
Commander Lewis improvises a solution: she fires Hermes' maneuvering thrusters to close the gap, then has the crew blow open the front airlock with a homemade explosive (mixing sugar and liquid oxygen), venting atmosphere to brake the ship's excess speed relative to Watney's trajectory. Beck, the crew's EVA specialist, flies out on a tethered maneuvering unit and physically catches Watney, hauling him back aboard Hermes. The book closes with Watney's final log entry, safely rescued, reflecting with gratitude and relief on how many people across the world worked to save him, and on human beings' basic instinct to help one another in crisis.
✓ Fact-verified against independent sources