Ryland Grace, Ryan Gosling, wakes from a coma aboard a silent ship, alone with the stars outside and no memory of how he got there. The vessel carries only two dead crew members—Captain Yao Li-Jie, Ken Leung, and engineer Olesya Ilyukhina, Milana Vayntrub—and Grace realizes he is far from Earth, adrift in a distant star system. He estimates a heroic, but extraordinarily long, journey back home, roughly thirteen years away, if he survives at all.
His memories begin to stitch themselves back together. He was a middle school teacher who explained to his students the existence of an infrared line known as the Petrova Line, a bridge between the Sun and Venus, and the way the Astrophage—an energy-absorbing creature—dimmed the Sun and threatened Earth with a dangerous cooling. He recalls telling his class that the world’s best minds were hard at work to resolve the looming crisis, even as he grappled with the fragility of life and memory.
A government agent named Eva Stratt, Sandra Hüller, arrives on Grace’s ship to assess the situation. She introduces him to a reality he could hardly imagine: a mission called Project Hail Mary. The objective is to investigate a phenomenon affecting multiple stars, except for Tau Ceti, and to discover a way to counter the Astrophage threat. The mission is framed as a one-way trip—a suicide mission in the eyes of many—yet Grace is expected to push forward, guided by the knowledge that Earth’s survival hinges on his success.
Back on the ship’s present, Grace pays tribute to the two fallen crew members before dealing with a cascade of mechanical glitches. His path toward Tau Ceti brings him face to face with a gargantuan alien spacecraft that sends a mysterious container to his own, which he retrieves with care. Inside, he discovers a map of the Eridan system drawn by the ship’s inhabitants, revealing that their origin traces back to 40 Eridani. This encounter opens a doorway to an unexpected ally and a radically different way of solving the crisis.
The alien craft builds a tunnel of xenonite that lets Grace step into a new world and meet a rock-like alien who mirrors his movements. This being, named Rocky, James Ortiz, communicates through echolocation and becomes the first true companion Grace has known on this mission. To bridge the enormous language gap, Grace fashions a translator so they can talk, and their bond deepens as they share knowledge, culture, and fears. Rocky is the sole survivor of a crew of 23 Eridians, and the two form a pact to work together, not just to save themselves but to save the starlit futures of both species.
The film explores Grace’s backstory in more depth through a set of flashbacks. Stratt’s introduction of Grace to Yao, Ilyukhina, and lead scientist Dr. Martin DuBois (briefly shown) underscores how high the stakes are and how fragile the mission’s success might be. A tragic mishap—an explosion caused by an ill-fated handling of the Astrophage—claims DuBois and the backups, changing the course of Grace’s life and forcing Stratt to push him to step into the role she believes he must fill. Grace must confront the distance between his inner fears and the bravery that will be demanded of him.
In the present, Grace and Rocky grow closer as they approach Tau Ceti’s world, which they rename “Adrian” to continue the Rocky motif. Grace identifies a lifeform that thrives on Astrophage, a bacteria he designates as Taumoeba, produced by Adrian’s ecosystem. Rocky offers to share the Astrophage necessary for Grace to return home, even if it means delaying his own return by a long time. The moment is deeply emotional, and Grace allows himself a rare, heartfelt hug with his alien friend.
A pivotal flashback reveals Grace’s inner conflict: a moment where he contemplates refusing the mission, which leads to Stratt drugging him to ensure his participation on the Hail Mary. The truth behind his memory loss adds a somber layer to the mission’s stakes, highlighting the sacrifices that accompany humanity’s desperate gambit.
As they press farther, a fuel leak threatens the Hail Mary, and the Taumoeba begins to eat through the xenonite containment. Grace’s quick thinking and the Taumoeba’s growing power create a race against time: can he save both his ship and his fragile alliance with Rocky? When the situation reaches a crisis point, Rocky sacrifices once more to protect Grace, enabling him to stabilize the vessel and push toward home—or so it seems.
Grace’s resolve hardens as he and Rocky continue their research, breeding Taumoeba to counter the Astrophage threat and, crucially, to keep both worlds alive. In the climax, Grace makes a life-altering choice: to rescue Rocky and ensure their shared mission survives, even if it means delaying his own return. He launches Taumoeba-laden probes back to Earth, hoping to turn the tide of the crisis from afar.
The probes reach Earth, and Eva Stratt reviews Grace’s logs with a blend of awe and determination. Back in Erid, Rocky and the Eridian scientists create a bio-dome where Grace can live and teach, offering the possibility that Earth and its far-flung allies might still thrive. Rocky conveys that Earth’s scientists have found a way for Grace to return home, but Grace asks for time to ponder the monumental decision, weighing the cost of homecoming against the responsibility he has carried across the stars.
In the end, the story remains a testament to resilience, unlikely friendship, and the enduring belief that even in the vastness of space, one person can change the fate of worlds. Grace, now a bridge between two civilizations, stands at a crossroads—with a future that could lead him home or extend his life among friends who changed everything about what it means to be brave.