What happens at the end of the Project Hail Mary book — and where it parts ways with the Gosling film
Andy Weir's 2021 novel and the 2026 film reach the same destination: Ryland Grace gives up his ride home to save his alien friend, and ends the story teaching science to a classroom of young Eridians. It's everything around that ending the film softens.
Here's how the book closes — and every place the Ryan Gosling version diverges.
How the book ends
Grace and Rocky beat the astrophage problem, breeding taumoeba — a predator that eats the sun-dimming organism — and Grace fires the findings back to Earth aboard small automated probes. Then disaster: the taumoeba have evolved to eat through xenonite, the material Rocky's entire ship is made of.
Rocky's fuel is doomed and he's stranded. Grace doesn't have enough fuel to save Rocky and get home, so he turns the Hail Mary around — knowing, in the book, that this is effectively suicide, since his food will run out and Eridian food is toxic to humans.

The epilogue jumps 16 years. Grace, now about 53 and walking with a cane, lives in a modest dome the Eridians built him. One morning, Rocky arrives with news: astronomers confirm Sol's brightness is back to normal.
Earth is saved, and Grace breaks down in tears — then dries his eyes and goes to teach his class of little Eridians. The book even explains his menu: food cultured from his own cloned cells. Grim, practical, very Weir.
Where the film changes it
- The rescue — in the book, Grace physically saves Rocky, hauling him through a toxic section of the ship and wiping away the black soot that was actually healing him. In the film, Rocky saves himself.
- Earth on screen — the film adds something the book never shows: an aged Stratt (Sandra Hüller) watching Grace and Rocky's final video log from a carrier cutting through a frozen ocean, as humanity receives the probes. The novel never leaves Grace's point of view.
- The timeline — the book's epilogue is 16 years on; the film's appears to be soon after arrival, with Grace still young and healthy.
- The lifestyle — the book's humble dome becomes a bright, spacious biodome complete with a beach and ocean water.
- The exit door — in the film, Rocky tells Grace the Hail Mary is fuelled and ready whenever he wants to go home. The book leaves the return far more remote.
So does Grace ever go home?
Weir has answered this directly. Describing the book's closing exchange to Entertainment Weekly, he summed up Rocky's offer:
"Hey, we can fuel up the Hail Mary now, and you can go home."
Grace's reply in the book — "I'm getting old and the trip is long" — is a maybe, someday, not now. Weir added the sobering maths: the return journey would take 16 years as Earth counts it, four to five from Grace's perspective, and roughly 25 years after the astrophage crisis began, Earth would still be a very cold place.