Following on from The Ark in Space, the time travellers teleport down from the Nerva Space Station to Earth, ostensibly uninhabited. However, the system is not functioning well, and the Doctor begins repairing it. The other two explore the surrounding area, but Harry falls down a crevasse and Sarah goes to seek the Doctor's help. He is nowhere in sight.
Roth, an astronaut, finds Sarah. He is obviously distressed, and explains that he has been tortured by an alien that lives in the rocks, together with its patrolling robot. He takes Sarah towards the astronauts' campsite, but refuses to approach the campsite, suspecting the astronaut Vural of collusion with the alien.
Three of the astronauts have captured the Doctor. They believe Nerva to be a legend, and tell him in turn that they had picked up a distress signal from Earth. They came to investigate, but their ship was vaporised when they emerged, leaving nine of them stranded. Then they began to vanish one by one. They blame the Doctor for this. Roth appears and the astronauts chase him, while Sarah frees the Doctor. Roth loses the others and meets up with Sarah and the Doctor. The Doctor also falls down a crevasse, and the robot returns, capturing Roth and Sarah and bringing them to the alien's spacecraft. The alien is Field Major Styre of the Sontaran G3 Military Assessment Survey, who has been experimenting on, and killing, the astronauts. Roth tries to escape but is shot dead by Styre.
Styre reports back to his Marshal via a video link. The Marshal is impatient for the intelligence report (without which an invasion of Earth cannot take place), but Styre admits that he has been delayed in his experiments.
Styre subjects Sarah to a series of terrifying hallucinations. The Doctor, free from the hole, has reached her and rips off a hallucinogenic device from her forehead, but she falls unconscious. The Doctor, enraged, attacks Styre, but the Sontaran easily fends him off. Styre shoots him unconscious (believing it to be fatal) when he runs away.
The robot, having captured the three remaining spacemen, brings them to Styre's ship, where it is revealed that Vural had tried to make a deal with Styre in exchange for his own life. However, Styre intends to experiment on Vural anyway. The Doctor recovers, disables the robot, and meets Sarah and Harry. He confronts Styre, goading him into accepting hand-to-hand combat. While the two fight, Sarah and Harry free the three astronauts, and then Harry climbs towards Styre's ship to sabotage it. Styre almost wins the fight, but Vural attacks him, saving the Doctor at the cost of his own life. Styre, now low on energy, heads back towards his ship to recharge, but the sabotage causes it to kill him.
The Doctor informs the Marshal that not only has Styre's mission failed, but that the invasion plans are in human hands. This is enough to ward off the invasion, and the three can return to Nerva or so they thought.