On the planet Pyris VII, two beings known as Korob and Sylvia have been sent on a mission of conquest by their home world. Using a matter transmuter, they assume human form to welcome the U.S.S. Enterprise landing party.
When one member of the initial landing party returns to the ship dead, Kirk, Spock and McCoy beam down to find Scotty and Sulu transformed into mindless zombies. Sylvia and Korob appear as witch and warlock and use scare tactics to keep the officers from investigating the planet and their motives. Kirk, Spock and McCoy are taken prisoner and shown examples of Korob and Sylvia's "powers," which includes heating a small model of the U.S.S. Enterprise over a flame and having the heat transfer to the orbiting ship.
Sylvia takes an interest in Kirk and decides to abandon her original mission in order to learn about human feelings and experiences. When she finds out the captain is merely using her to gain an advantage, she becomes furious and retaliates.
Korob ultimately helps the crew to escape, but Sylvia turns into a giant black cat and crushes him. Kirk then uses Korob's wand transmuter to destroy Sylvia's source of power — her amulet — before smashing the wand. Their powers gone, the aliens revert to their true form — fragile blue creatures who quickly die in the planet's atmosphere. With their demise, Scotty and Sulu return to normal and the landing party beams back to the U.S.S. Enterprise.