After “First Man,” Ryan Gosling is taking on another astronaut movie.

The actor will produce and star in “Project Hail Mary” with MGM in negotiations to acquire the project, based on the upcoming Andy Weir novel.

Ken Kao is also producing. “Project Hail Mary” is centered on a solitary astronaut on a space ship who is trying to save Earth. CAA is brokering the book deal with David Fugate of Launch Books. CAA also represents Gosling. “Project Hail Mary” will be published next spring by Random House.

Weir’s first novel, “The Martian,” was self-published in 2011. The story follows an American astronaut stranded alone on Mars in the year 2035. The film adaptation, directed by Ridley Scott and starring Matt Damon, was released in 2015 and became a massive box office success with $630 million worldwide and seven Academy Award nominations.

In 2017, Weir published his novel “Artemis,” which follows a woman named Jazz, a directionless twentysomething constrained by her small town Artemis — the only city on the moon. With debts to pay and a salary that barely covers the rent, she can’t say no when a life-changing opportunity drops in her lap. Fox and New Regency bought the film rights and attached Phil Lord and Chris Miller to direct.

Gosling was nominated for Oscars for “Half Nelson” and “La La Land.” His most recent starring role came in 2018’s “First Man,” playing astronaut Neil Armstrong with Damien Chazelle directing. The news about “Project Hail Mary” was first reported by Deadline Hollywood.