In the near future, scientists observe the Sun dimming at an exponential rate, coinciding with the formation of a dim infrared line from the Sun to Venus (dubbed the Petrova line after its first observer, Dr Irina Petrova). As the dimming will cause a catastrophic
ice age within thirty years, the world's governments appoint former
European Space Agency administrator Eva Stratt to lead a task force to solve the problem, giving her almost unilateral authority. A
space probe is sent to Venus to investigate the makeup of the Petrova line. Stratt appoints Ryland Grace, a
junior high school teacher with a PhD in
molecular biology, to study a sample from the Petrova line. He discovers that it is made up of
single-celled organisms which consume and release
electromagnetic radiation, which he names "Astrophage", and determines that Astrophage breeds by absorbing energy from the Sun and carbon dioxide from Venus. Astrophage has also infected and dimmed nearby stars; however, one star,
Tau Ceti, has resisted the infection. A
starship, the
Hail Mary, is created to travel to Tau Ceti to investigate, using a special engine fueled by Astrophage. Meanwhile, terraforming efforts are made to increase the
greenhouse effect and mass-produce Astrophage. They can only breed enough Astrophage for a one-way trip, so the mission will return its findings to Earth using unmanned mini-ships called "beetles". Grace trains the two science experts for the mission, but they are killed in an accident shortly before launch. With no time to train a comparably skilled replacement, Stratt forces Grace to join the suicide mission against his will; he is sedated, placed aboard the ship, and administered a temporary amnesia-inducing drug to ensure he does not sabotage the mission out of spite. Four years and eight months later, Grace emerges from his coma aboard the
Hail Mary as it approaches Tau Ceti. He has
no memory of his identity or situation, and finds that the rest of the crew has died en route; over the ensuing weeks, he gradually recovers his memory of the mission. The
Hail Mary is approached by an alien starship, which Grace names the "Blip-A" after its default display name on the radar. The starship sends a star-map sculpture, indicating it came from
40 Eridani. The ships dock, and Grace develops a system to communicate with the eyeless, spider-like, five-legged, rock-like alien whom he names "Rocky". A skilled engineer, Rocky has been in the Tau Ceti system for 46 Earth-years and is the last survivor of his crew, the rest having died of
radiation sickness. As Rocky's planet, 40 Eridani A b (dubbed "Erid" by Grace), is also under threat from Astrophage, Grace and Rocky agree to cooperate. Grace learns that the Eridians are ignorant of
relativity and thus
Blip-A has more than enough Astrophage fuel for both ships to return to their planets. Grace and Rocky find Tau Ceti has its own Petrova line and hypothesize that the connected planet, dubbed "Adrian", is home to an organism that preys on Astrophage, keeping its population in check. Grace and Rocky construct a 10-kilometer chain made of xenonite, an Eridian super-material, in order to collect a sample. A hull breach occurs during collection, and Grace and Rocky risk their lives to save each other. From the sample, they identify the predator and name it "Taumoeba". During study, some Taumoeba get into the Hail Mary's fuel lines and eat most of the Astrophage inside. Grace and Rocky jettison the infected tank and sterilize the Hail Mary by flooding it with nitrogen, which is lethal to Taumoeba, Grace and Rocky use
selective breeding to produce Taumoeba that can survive the atmospheres of Venus and the planet in 40 Eridani, where Astrophage breeds. Rocky repairs and refuels the
Hail Mary before parting ways with Grace. En route to Earth, Grace discovers that he accidentally bred into the Taumoeba the ability to penetrate their xenonite containers. He quarantines them on the Hail Mary but realizes that the
Blip-A is made almost entirely of xenonite, meaning that the Taumoeba will consume its Astrophage fuel and leave Rocky stranded. Grace is forced to choose between returning to Earth as a hero but dooming the Eridians, or saving the Eridians while facing his own starvation on Erid where the food is toxic to humans. Grace sends the beetles back to Earth with Taumoeba farms and instructions to save the Sun. He locates the
Blip-A and rescues Rocky, who is overjoyed and points out the possibility that Grace could survive by consuming Taumoeba. Sixteen years later, Grace is living on Erid, now rid of its Astrophage infection. Using Grace's digital archive of human knowledge, the Eridians have built him a comfortable environment and synthetic food. Rocky tells Grace that Earth's Sun has returned to its original
luminance, marking the success of Grace's mission. Knowing that humanity has survived on Earth, Grace contemplates going home before returning to his current job as a science teacher for young Eridian students. == Writing process ==