As the Moon streaks through space, Sandra monitors a passing asteroid. Paul orders Kano to determine the damage potential if it collide with the Moon. The asteroid suddenly changes course and Kano confirms it will slam into Alpha in less than a minute. At the last minute it changes course, just missing the base and heading off into space before exploding. The personnel determine that they're changing course toward some unexplained black spherical phenomena.
Pilot Mike Ryan takes Eagle One to investigate the approaching phenomena but is unable to get any readings from it. Bergman doesn't have any luck determining what it is from his initial calculations. Koenig has Mike fire a laser into the black object without effect. They start to lose Mike's transmission signal and the pilot resolves fly into it to conduct further investigation. He switches on anti-gravity screens and proceeds toward the object. Bergman arrives at the command centre to tell them that he's identified the object: a black sun. Koenig orders Mike to abort but he's unable to pull free of the black sun's gravitational force. The Eagle and its pilot are destroyed.
Afterward, Bergman and Koenig both blame themselves for not perceiving the danger soon enough. Koenig wonders what they can do when the Moon will impact the object in three days. The command staff meet and Bergman explains that the gravitational force will increase to the point where nothing can escape its gravitational pull. They can't avoid the black sun but they can use their eight anti-gravity towers, linked together, to create a force field that will absorb the gravitational pull and use it to protect the Moon and its inhabitants.
The crew begin their work to strip out the Eagle generators and boost the anti-gravity towers. Koenig and Bergman go out on the Moon's surface to demonstrate the force field in its initial stages. Alan than flies low and opens fire, but the force field fully protects the two men on the surface. Once they return, Dr. Russell berates them for taking a foolish risk but Koenig notes that they did it for morale and if it hadn't succeeded, they would have died only a day sooner. As Bergman leaves, Koenig warns that the black sun is draining their power and he plans to launch a lifeboat: one Eagle with an emergency crew.
Bergman and Kano check the calculations from the force field test and how the power is dropping. Kano defends the computer systems but Bergman warns they'll have to shut down all non-essential systems for the force field.
Paul reports to Koenig that the black sun's gravitational force is increasing, reducing their safety margin by six hours. He suggests that activating the force field early will slow them down but Koenig is reluctant to use the power until the last minute. He tells Bergman they need to activate the force field but the professor advises against it. Koenig proceeds and they power down the Moonbase to power the force fields. One of the towers gives out and a short circuit stuns Bergman. Dr. Russell checks and assures him that his mechanical heart saved him.
The Moon proceeds toward the Black Sun as the personnel work to prepare the lifeship Eagle. Kano continues to insists they need power to the computer. Koenig overrides him and they shut down all power to activate the force field at full strength. It works, buying them a reprieve. Carter hears about the lifeboat Eagle and demands to know why he and the majority of the crew weren’t informed. He insists that he has to be one of the six passengers since he's the only pilot capable of getting them to safety. Koenig informs the rest of Alpha that they have prepared a lifeboat and the computer will select six people best suited to survival. Among them are Alan Carter,. Sandra, and Dr. Russell. Bergman notes to Dr. Russell that they knew Koenig wouldn't go.
Koenig briefs the six passengers, noting they'll have enough supplies for five weeks. Dr. Russell insists she shouldn't go but Koenig overrides her, saying the list is final. He insists it makes a difference to him that she leave.
As temperatures on Alpha continue to drop, the lifeboat passengers prepare for departure. Paul wishes Sandra goodbye in person. Koenig gives them a final goodbye message wishing them luck
As the Alphans prepare for collision, Bergman stops by Koenig's office with thermal gear and talks of how the odds of them surviving are so astronomical. He lights up a cigar despite Dr. Russell's health warnings.
In space, Dr. Russell talks to Sandra about her childhood fear of the dark.
The Moon draws ever nearer to the black sun and Bergman waxes philosophical on the fact that they've survived so long with the odds against them. He wonders if some cosmic intelligence is responsible for their continued existence. Koenig dismisses Paul from his duties and Bergman hauls out an old bottle of whiskey and pours drinks to celebrate.
The Alphans play cards, chess, and music and quietly await their fate together. The Moon enters the black sun and it and the Alphans turn translucent as the force field holds.
Aboard the Eagle, the passengers start to turn translucent as well.
The Alphas realize they don't feel anything and Bergman wonders if they even exist. He and Koenig become centuries old. Bergman can hear each others' thoughts and their knowledge expands to the infinite. A woman' voice speaks, identifying it as a friend and inviting them to join it. They look upon the stars as the voice explains that it is no hurry and exists on a different timescale from them. Bergman wonders if it is God but the voice wishes them well.
The Moon emerges from the black sun and the Alphans revert to normal. They spot the survival ship nearby. It has somehow been pulled along with them against all odds. The Alphans are reunited as Carter explains they went in the opposite direction of the black sun. Bergman can't account for it and Dr. Russell notes that something brought them home.