Stardate 4211.4: The Enterprise is in orbit above the planet Neural, where McCoy is taking plant samples while Kirk and Spock patrol the area. Spock notes there are footprints of a mugato, a large ape-like carnivore. Kirk was there before on his first planetary survey and notes the low-tech inhabitants were peaceful. They're interrupted when they spot villagers… carrying flintlocks. A group of tribesmen are approaching, led by Kirk's old friend Tyree. Kirk throws a rock to distract one of the villagers, who accidentally fires off a shot, warning Tyree. Kirk and Spock run back to McCoy's location but Spock is shot and wounded. Kirk manages to pick him up and get him to the rendezvous spot, and they beam up just ahead of the villagers arriving.
Back on board the ship, McCoy gets the injured Spock to Sickbay. A Klingon vessel arrives in orbit but doesn't notice them, but they may have to leave orbit to avoid detection. Kirk assumes the Klingons have something to do with the villagers' new weapons but the bridge crew note that if so, why relatively primitive weapons. A concerned Kirk goes to Sickbay where McCoy notes that they have no replacement organs and only Spock's Vulcan physiology can heal him. Dr. M'Benga, who interned on Vulcan, is taking care of Spock and Kirk has McCoy accompany him to the planet to determine what's going on. They set up a rendezvous schedule and don native costumes, then beam down near Tyree's camp. However, a mugato attacks them and bites Kirk before McCoy can disintegrate it with his phaser. McCoy is unable to contact the Enterprise, which has left orbit to avoid the Klingons. The doctor doesn't have an anti-toxin, and several of Tyree's hill people arrive as McCoy tries to get them to provide help.
The hill people take McCoy and Kirk to a cave to await Tyree's return along with his wife, who knows how to cure the poison. Tyree and his wife Nona are watching the villagers and she suggests they get the "firesticks." Tyree, a Kahn-ut-tu witch woman, believes the villager will return to their peaceful ways but Nona doesn't believe it. He claims she cast a spell on him and she uses local leaves to intoxicate him. However, one of Tyree's people finds them with the news about Kirk. Nona goes to the cave where she secretly observes McCoy using a phaser to heat rocks to keep Kirk warm. As Tyree arrives, she insists he tell her everything he can about Kirk so she can treat him.
Aboard the ship, Nurse Chapel is holding the unconscious Spock's hand while M'Benga explains that Spock is focusing his entire mind on regenerating the body damage… and he knows she's holding her hand.
As McCoy looks on, Nona uses a mahko root and cuts her palm, then merges her blood through the root with Kirk's. She collapses from the effort but Kirk is cured. He passes out from exhaustion while Nona wakes up and notes that now her and Kirk's souls are as one and he is hers. Tyree warns that according to legend, the man can deny the woman nothing. Later, Kirk wakes up and greets his old friend Tyree and wants to discuss the situation with the villagers. Nona is clearly eager to get the captain's help.
M'Benga tells Chapel to do whatever Spock asks if he wakes up. Meanwhile, Tyree notes that the villagers first acquired weapons a year ago and make them in the village. Nona says Kirk can do more to help his friend and asks them to teach her. Kirk insists they can't interfere in the hill people's development but Nona insists Tyree could die. Tyree refuses to fight and wonders how Kirk can let his friend die. She storms out and Kirk admits that he's concerned about what they may have to do if they find the Klingons are supplying guns.
Kirk, McCoy, and Tyree get to the village, subdue a villager, and take his gun. They get to the blacksmith and discover coal and sulphur. They overhear the village leader, Apella, talking to the Klingon representative Krell. Looking inside, they find enough evidence to show the Klingons are using their advanced technology to make it appear the villagers are manufacturing the guns. Krell and Apella come in but McCoy accidentally sets off his tricorder. They fight their way past the two men but more villagers arrive. Kirk and McCoy fight their way past them and escape with the evidence.
Aboard the Enterprise, Spock starts to regain consciousness and tells Chapel to slap him. She reluctantly agrees but Scotty arrives and misunderstands, stopping her. M'Benga intervenes and continues slapping Spock until he recovers full consciousness. M'Benga explains that Vulcans need to be brought of their healing trance at the last minute.
The next day, Kirk shows the hills people how to fire the stolen weapon. McCoy objects and wonders if Nona is influencing Kirk. The captain explains that they have no choice but to provide the hill people with equal weaponry to maintain the status quo. McCoy doesn't have any other alternative, even though they may have no choice but to escalate the arms race if the Klingons do. Kirk plans to use Nona to convince Tyree.
Spock takes command as the Enterprise returns to orbit, and he prepares to contact the captain. Kirk talks to Nona privately, and she attempts to seduce him using a scented flower. Tyree secretly observes them and considers shooting Kirk, but finally throws down the matchlock in disgust and runs off. The first mugato's mate attacks and Nona tries to flee while Kirk tries to shake off the flower's effect. He finally manages to disintegrate it, and then Nona knocks Kirk out with a rock and takes the phaser.
Tyree returns to camp where McCoy insists they need to recover the weapon he dropped. They return to find a stunned Kirk. Nona finds a villager patrol and tries to give them the phaser, but they don't know what it is and she can't activate. The villagers attack her while Kirk realizes his phaser is gone. They go after her but the villagers figure it's a trap and kill Nona. One of them fires and wounds McCoy in the arm, while Kirk, Tyree and others attack and dispose of the villagers. Kirk is forced to pull the furious Tyree off of a villager as he beats the man's head in with a rock. Tyree demands more guns and resolves to kill the villagers who escaped. Kirk and McCoy call up to the ship and confirm Spock is okay. A tired Kirk asks to be beamed up.