The Enterprise is en route to deliver vaccines for a plague or the New Paris colony at Marcus 3, but stop to investigate a quasar-like phenomena, Murasaki 312. High Commissioner Farris, in charge of the relief effort, is not happy with the delay but Kirk notes they have three days to make the rendezvous. Spock takes a team aboard the shuttlecraft Galileo to investigate. Aboard are Scotty, McCoy, astrophysicist Boma, Yeoman Mears, Navigator Latimer, and astrophysicist Gaetano. The shuttlecraft is pulled off-course into the phenomena and lose contact with the Enterprise, with its sensors overloaded by the radiation.
Kirk orders a search but there are at least four solar systems and the sensors are off-line. Ferris can't resist reminding Kirk he objected to the expedition and they have two days before the must depart. They locate one M planet, Taurus 2, in the center of the phenomena and Kirk orders a search of the planet as the only possible place the shuttlecraft crew could survive.
McCoy tends to the injured crew and they move outside while Scotty tends to repair. Spock warns that it's unlikely the Enterprise will be able to find them due to the ionization.
Kirk launches a second shuttlecraft, Columbus to search the planet visually while they work to get the transporters on-line.
While Spock works on repairs, McCoy wonders if he is interested in command. Spock notes he has no choice but plans to proceed logically. Scotty reports they've lost a substantial amount of fuel, enough that they will have to lose at least 500 pounds, or three grown men. McCoy suggests they lose the equivalent in equipment, but Spock notes they have little spare equipment. An increasingly irritable Boma wants to know who will choose and Spock notes it will be his decision, reached logically.
Latimer and Gaetano are patrolling in the fog when they hear noises from all around them. Latimer climbs up on a rock… and takes a spear in the back. Spock and Boma go to investigate and finds Gaetano unsure as to what happens but saying he saw some giant ape-like creature.
With the transporters off-line, Kirk orders Columbus to expand its search range despite the fact it will miss dozens of miles on each search.
Boma asks Spock to say a few words over Latimer's body, but he prefers to logically work to save their lives. Boma and McCoy deal with the burial and Scotty reports they've lost the fuel. Outside, the local primitives start moving in and Boma suggests they hit back hard. Spock isn't impressed with the violent approach but takes Boma and Gaetano out into the fog. The primitives throw shields at them and Spock has them fire on a wide arc. Spock believes the phaser fire has driven the creatures off and returns to the Galileo with Boma while Gaetano remains on watch.
Back at the shuttlecraft, Scotty announces he's discovered a substitute fuel supply: the phaser energy. Spock believes the primitives won't attack again long enough for them to lift off, but notes the Enterprise will have to abandon them in 24 hours.
The transporters are back on-line and Kirk orders landing parties down to the planet.
The primitives throw rocks, disarming Gaetano and cutting him off from his phaser. He tries to climb to safety but fails and one of the natives closes in and kills him. Spock, McCoy, and Boma return to find his phaser but nobody. Spock sends them back to the shuttlecraft with Gaetano's phaser and his own, then goes out to find Gaetano's body and to satisfy his scientific curiosity. Spock finds Gaetano's mutilated body nearby and takes it back to the ship as the natives throw spears at him. He gets back to the Galileo and is forced to conclude the natives are acting illogically. The creatures attack the shuttle, hitting it with boulders, and Scotty warns he'll need at least an hour to recharge the fuel cells.
With a little under three hours remaining, Kirk continues to supervise the search but the sensors are still off-line. Ferris demands to know what the captain plans to do and warns that he will order the ship to continue at the end of that time.
Spock has Scotty use the ignition system to electrify the hull and drive the primitives off. Boma asks for a burial despite the risks to the people participating. Spock reluctantly agrees.
A landing party returns in with fatalities, noting the primitives are all over the planet. Ferris arrives to announce Kirk's time is up and takes command, ordering the ship to leave orbit. Kirk recalls the shuttlecraft and landing parties, and they have 23 minutes before the Columbus returns.
Scotty reports they have refueled and can lift off for several hours then make a controlled landing. The coast appears clear and Spock orders the burial to begin.
The Columbus returns and Kirk orders them out of orbit… at impulse power.
The primitives attack during the funeral and Spock is trapped beneath a boulder. McCoy and Boma rescue him and they manage to lift off, but the natives hold the ship down. Spock uses the boosters despite the fact they won't be able to hold orbit. Spock notes it was illogical for them to rescue them and that they won't be able to land, but is forced to admit they are out of alternatives as the Enterprise has left orbit. He considers the situation… then jettisons and ignites the fuel.
Sulu spots the "flare" and Kirk orders them back, while the Galileo begins to plummet into the atmosphere. Spock is forced to admit it was a gamble, as McCoy gently mocks him over his decision. The cabin begins to heat up... and they are beamed to safety.
Later on course to Marcus 2, Kirk and McCoy give Spock a hard time about the fact that he made a purely human act, since Spock claims he did so out of logic.