Stardate not given: The Enterprise arrives in orbit above a "ghost planet," a Moon-sized planet with an atmosphere and mass similar to Earth, with vegetation having developed in only a few thousand years. Kirk takes down a landing part of Sulu, McCoy, and Chief Geologist D'Amato. As they start to beam down, a beautiful woman appears in the transporter room, says they cannot go, and touches the transporter officer, Ensign Wyatt. He collapses, dead, as the landing party materializes on the planet below. They call up to the ship but suddenly the planet is hit with planetquakes. The Enterprise crew are similarly impacted and realize that the planet has disappeared.
The landing party suspects the Enterprise has blown up but with no way to confirm, start looking for food and water. Aboard the ship, they determine there are no signs that the planet has blown up. Lt. Rahda notes that the constellations have changed and they quickly determine they've been thrown almost a thousand light years from the planet. Dr. M'Benga reports that the ensign has died of some kind of massive cellular shock.
On the planet, they determine all the vegetation is poisonous and there's no water. They split up to look for food and Sulu detects a massive magnetic reading. D'Amato is checking rock formations and encounters the woman from the ship. She approaches him and identifies him by name. She tries to reassure him and touches him, saying she's only for him. McCoy picks up a huge lifeform reading on his tricorder, from D'Amato's section. They head for the geologist's location and find him dead, every cell in his body disrupted.
Kirk tries to use the phaser to dig out a grave but discovers that the planetary surface is impervious to high temperatures. Sulu starts analyzing the material while they wonder what killed D'Amato.
The Enterprise is eleven hours away at Warp 8 and Scotty reports that something doesn't feel right. Spock dismisses his claim as emotionalism but considers.
The landing party finishes burying D'Amato in a cairn and wonder if there's an intelligent being or beings responsible.
Scotty has Ensign Watkins check the bypass valves on the matter/anti-matter reactor but when he goes back, he encounters the same mysterious woman. He lies about the valves but she identifies the emergency overload bypass. Watkins calls out saying there's a strange woman present, then screams abruptly. As Scotty goes to investigate, the woman disappears, folding in upon herself. Spock orders an intruder alert to find her.
The landing party concludes the planet is artificial and wonders if the planet is hollow. Night falls and Sulu takes the first watch.
Spock has Dr. M'Benga confirm that Watkins died the same way as Wyatt, and determine he was murdered while checking the matter/anti-matter reactor.
While Kirk and McCoy sleep, the woman appears and approaches Sulu. She identifies him by name and rank and tries to touch him. He uses his phaser on her but she's totally unaffected. Sulu calls out, waking up Kirk and McCoy and then trips backward as she glancingly touches him. Kirk intervenes and when she touches the captain, nothing happens. She refuses to answer any questions and warps herself away.
On the Enterprise, the intruder search proves negative, but the ship begins to accelerate. Scotty reports that the emergency bypass control is fused. Scotty confirms that it would have taken their full phaser banks to do the damage. Spock suggests someone go into an access tube to cut off the fuel flow but it will require someone with a magnetic probe. Scotty is unsure if it can succeed but volunteers as the most qualified person. Spock proposes to follow up on Scotty's "feeling" and run a complete system scan.
On the planet, Sulu recovers and they conclude that the woman can only kill one of them at a time.
Scotty enters the access tube and has it sealed off so it can be jettisoned in an emergency, then begins to work with eight minutes left.
On the planet, the woman appears to the landing party and says she's for Kirk. McCoy and Sulu shield him with their bodies. She insists they are invaders but has no lifesign readings. She identifies herself as Losira, commander of the station. Kirk tries to get through to her as she insists she doesn't want to kill them, but she has to. She says there are others on the planet but no longer. She then disappears and they detect another power surge. They follow it to a rock wall and a door slides open. With no other options, they go in.
On the Enterprise, Spock determines that the ship was teleported away and assembled slightly out of phase. With time running out, he has Scotty reverse the polarity on his magnetic probe to seal the rift. The probe jams and Scotty advises them to eject him, but Spock refuses and tells him to continue. With seconds to spare, Scotty completes the reversal and seals the rift.
The landing party arrives in a control chamber with a glowing computer cube ob the wall. Losira appears and they form a circle until she's forced to admit she has come for Kirk. Sulu and McCoy block her again as she begs them to let her touch Kirk. The computer counters by creating two more Losiras. The three Losiras advance but Spock and a security guard arrive and destroy the computer just in time. A final projection of Losira appears as they determine the computer coordinated all of the attacks on them. Losira identifies herself as a Kalandran and the outpost was wiped out by disease created when they created the planet. As commander, she programmed the computer to use her image to defend against any intruders. They consider how beauty supplies, and beam up to the ship