Three U.S. astronauts—commander Jim Pruett (Richard Crenna), “Buzz” Lloyd (Gene Hackman), and Clayton “Stoney” Stone (James Franciscus)—are the first crew of an experimental space station on an extended duration mission. Approximately 60 days into a planned 90-day mission, Lloyd begins exhibiting erratic and substandard performance, and NASA management elects to end the mission early. While oriented for retrofire, the main engine on the Apollo spacecraft Ironman One fails. Mission Control determines that Ironman does not have enough fuel remaining to use the reaction control system as a backup to initiate atmospheric entry. Nor is there sufficient fuel to re-dock with the station and wait for rescue. The crew is effectively marooned in orbit.

NASA debates whether a rescue flight can reach the crew before their oxygen runs out in approximately two days. There are no backup launch vehicles or rescue systems available at Kennedy Space Center in Florida and NASA Administrator Charles Keith (Peck) opposes using an experimental U.S. Air Force lifting body, the X-RV, that would be launched on an Air Force Titan IIIC booster rocket; neither the spacecraft nor the booster is man-rated, and there is insufficient time to put a new crewed NASA mission together. Even though a Titan IIIC is already on the way to nearby Cape Canaveral Air Force Station for an already-scheduled Air Force launch, many hundreds of hours of preparation, assembly, and testing would be necessary.

Ted Dougherty (David Janssen), NASA’s Chief Astronaut, opposes Keith and demands that something be done, claiming most time-consuming preparation items can be dismissed. The President agrees with Dougherty and tells Keith that failing to try a rescue mission will kill public support for the crewed space program. The President tells Keith that money is no factor; “whatever you need, you’ve got it”. Despite his initial opposition, Keith accepts the decision and works furiously on the rescue mission. Dougherty appoints himself as pilot.

While the astronauts’ wives (Lee Grant, Mariette Hartley and Nancy Kovack) agonize over the fates of their husbands, all normal checklist procedures are bypassed to prepare the X-RV for launch. The wives are brought to the control room and allowed to speak to their husbands; however, this exacerbates Lloyd’s already-agitated condition. As launch time approaches, a hurricane headed for the launch area threatens to cancel the mission. In the final minute before launch, high winds cause a scrub of the mission. Launch director Keith angrily admits the rescue attempt now cannot be made. However, a weather technician informs Keith the eye of the storm will pass over the Cape 90 minutes later during a subsequent launch window, permitting a launch with Dougherty aboard in time to reach the ship while at least some of the crew may survive. The crew is informed a Soviet Union Soyuz (spacecraft) has been launched; with no knowledge of the intentions or purpose of the Soviets, the NASA crew concentrates on its own efforts.

The eye of the hurricane does pass over the Cape as predicted, and the launch is made just as storm winds begin to rise. In orbit, insufficient oxygen remains for all three astronauts to survive until Dougherty arrives. There is possibly enough for two, presenting a previously-unthinkable decision. Pruett and his crew then debate what to do. Stone tries to reason that they can somehow survive by taking sleeping pills or otherwise reducing oxygen consumption; Pruett responds this is unlikely to achieve enough oxygen savings to be successful. An agitated Lloyd offers to leave since he is “using up most of the oxygen anyway”, but Pruett overrules him. He orders everyone into their spacesuits then leaves the ship, ostensibly to attempt repairs, although this option has been repeatedly dismissed as futile and wasteful of oxygen.

When Lloyd sees Pruett going out the hatch, he attempts to follow, even though he is tethered to the ship. Stone restrains Lloyd, and they both watch Pruett. There is a hiss of air as large gash is torn in Pruett’s space suit on a metal protrusion. Helpless to stop the leak and quickly losing consciousness, Pruett drifts away from the ship as Lloyd and Stone look on. With Pruett gone, Stone takes command and sedates Lloyd to near unconsciousness.

The Soyuz spacecraft suddenly appears and its cosmonaut tries to make contact. He can do nothing but deliver oxygen, since the Soviet ship is too small to carry additional passengers and lacks equipment to dock with the Apollo. Stone and Lloyd, suffering oxygen deprivation and lapsing into semiconsciousness, cannot understand the cosmonaut’s gestures or obey Keith’s instructions from Houston. Lloyd drifts out of the hatch and away from the ship.

Dougherty arrives in the X-RV and begins a spacewalk to retrieve the astronauts. The Soviet cosmonaut shines a light on Lloyd, drifting slowly away from the Apollo; Dougherty retrieves him using a maneuvering pack. The cosmonaut moves into the Apollo and slaps an ill-fitting oxygen tank onto Stone’s suit fittings. As Dougherty returns with Lloyd in tow, Stone begins to regain consciousness with the renewed oxygen flow. Dougherty and the cosmonaut transfer the two surviving and still dazed Ironman astronauts into the rescue ship, where they exchange “thumbs up” gestures. Dougherty reports the crew transfer to Houston, where the NASA crew erupts in applause, before he adds, “Pruett’s gone,” to which Keith responds grimly, “We know.”

After separating, both the Soviet ship and the X-RV execute retrofire to return to Earth, and the final scene fades out with a view of the abandoned Ironman One adrift in orbit.