The U.S.S. Enterprise is on a routine mission in deep space when a beautiful young woman beams onto the bridge. Without a word, she touches a band on her wrist and everyone is rendered unconscious. She moves around the bridge until finally she comes to Spock. Smiling, she lays a hand on the Vulcan's head, as if she's found what she was looking for.
When Kirk awakes, Spock is gone from the bridge. Before the captain can find out where his first officer has gone, McCoy calls, demanding his presence in sickbay immediately. Spock's body lays on a diagnostic table, on full life support. McCoy explains that his brain is gone ... miraculously removed with some technology that the doctor has never seen before. Every nerve was sealed and there was no blood lost. However, McCoy tells him if the Vulcan's brain isn't returned to his body within 24 hours, Spock will die.
Kirk orders the starship in pursuit of the woman's ship. By following their ion trail, the Enterprise arrives at the sixth planet in the Sigma Draconis system. When Kirk and party beam down, they find a rough, frozen world inhabited by two peoples: the Morgs, who are comprised solely of men, who live on the surface in a primitive culture, and the Eymorgs, an all female group who live deep under the planet's surface. While the Eymorgs live in a highly technological society, they don't understand that technology and are trained to perform various tasks — like the operation enabling them to steal Spock's brain — by what is known as the "Great Teacher." This "teacher" was left behind by ancient technologists who once lived on the planet.
McCoy, having fashioned a device which will control Spock's body without the aid of his brain, beams down with the Vulcan to join Kirk and his party. They find Kara, the woman who beamed aboard the Enterprise. They quickly realize that Kara doesn't have the skill or knowledge to have performed the operation on Spock, and she tells them about the Great Teacher.
Finally, Kirk finds Spock's brain. The Eymorgs have hooked it up to run their central control system. The brain is now revered as the "Controller," which they hope will control their central systems for the next 10,000 years. After trying unsuccessfully to get Kara to repeat the operation on Spock in reverse, McCoy submits to the Great Teacher device and gains the knowledge needed to restore Spock's brain and save the Vulcan's life.
Without their Controller, the Eymorgs fear for their existence. Kirk suggests they share their greater knowledge with the Morgs and live together on the surface.