The Enterprise is ordered to monitor Arachna, a burned-out supernova, during its cycle of strongest emissions. They pick up a transmission from the supernova's only satellite, Cepheus, in an Interstat code, which went out of use 200 years ago. Spock can only identify one word that is repeated twice: "Terratin." The transmission stops and Kirk orders Sulu and Arex to set course for Cepheus, despite McCoy considering it a waste of time.
As they approach the planet, Spock checks the survey records and confirms that Cepheus is a Class M planet. However, it has a crystalline structure and a molten core. As they approach, they detect surface eruptions and Kirk suggests that the volcanic eruptions may be interacting with the crystals, generating random radio signals.
On the planet's surface, energy beams focus through a crystalline dish of manmade origins and are transmitted up into space.
Spock detects a wave broadcast passing through the ship and advises that they confirm the ship is unharmed before they proceed. All ship's department report in that everything is normal and McCoy notes that the lab animals in Sickbay haven't reacted to any changes in the environment. Arex pilots the Enterprise into an elliptical orbit to make a single pass. As the navigator begins his scan, light suddenly flares throughout the ship, blinding the Edosian. Everyone glows from the energy exposure for a few minutes, and then the wave bombardment diminishes. Arex confirms that his blindness is temporary and Uhura checks with all departments and makes sure there are no injuries. Spock reports that the wave bombardment is penetrating the shields and continuing at a lesser level.
Scotty calls the bridge to inform Kirk that the dilithium crystals are falling apart, unwinding and damaging the warp connections. Kirk and Spock go to Engineering and Scotty tells them that they will have to rewrite the connections to the impulse drives. Spock analyzes the dilithium fragments and informs the others that the dilithium is fracturing in spirals because of the wave bombardment, even though dilithium molecules are the hardest ones known to science. Lt. Gabler comes in to inform Scotty that the crew can no longer handle their tools because they have grown. As Scotty goes to investigate, Spock and Kirk realize that they appear shorter. Mess Officer Briel calls from the messing hall to report that everything there is enlarging and the crew is starting to panic. Spock and Kirk return to the bridge and discover that the shrinkage is now obvious. Spock suggests that it is equally likely that they are shrinking as much as the ship is growing.
Kirk orders Sulu to take them out of orbit but the ship doesn't have enough power. As the crew continues shrinking, Spock reports that the wave bombardment is more complex than anything he's experienced. Scotty calls to tell Kirk that they've repaired the connections, and the bridge crew tries to reduce power despite the fact that the controls are quickly becoming unmanageable.
McCoy calls Kirk and Spock to Sickbay and shows them that tissue samples have confirmed that they are shrinking. The lab animals are shrinking and Spock points out that their uniforms, made from an algae-based substance, are shrinking along with them. The coral in the aquarium is shrinking while the rock inside of it is remaining the same. DNA and dilithium share a common spiral structure but the human body isn't as fragile. McCoy notes that there is a limit to how tightly their DNA will compact, meaning that there's a limit to the shrinkage.
Back on the bridge, Spock determines that they will lose control of the ship when they reach 1 centimeter in height, in 32 minutes. As they jury-rig controls to keep control of the Enterprise, Sulu starts to set the timer on the phasers to launch a bombardment on the planet's surface. Kirk points out that the bombardment is coming from an area over a third of the planet's surface and they have no way to pinpoint it. The timer dial moves, knocking Sulu off the console and breaking his leg. Kirk and Arex carry him to Sickbay but discover that the turbolift door won't respond to them. The captain uses a discarded needle to trigger the eyebeam so they can get Sulu to McCoy.
In Sickbay, McCoy confirms that Sulu has a broken leg and points out that they are seeing increasing number of injuries. Chapel suggests that they use a microscopic laser from inner-ear surgery and goes to get it. She trips and falls into the aquarium, and is unable to climb out. Kirk hears her yelling and goes to investigate, and pulls her out with surgical thread. McCoy repairs Sulu's leg with the laser, and Spock arrives and tells them that the shrinking will stop when they reach 1/16 of an inch. Kirk tells him to calculate the epicenter of the transmissions, figuring that it's as good a place as any to beam down. The captain then calls Scotty and tells him to take a crew to the transporter room because he's beaming down alone.
In the transporter room, Scotty and his men jury-rig the controls while Spock gives Kirk a makeshift miniature communicator. Kirk has Scotty rig a timed transport for ten minutes. As they prepare to activate the controls, Spock points out that they have no idea what will happen when the transporter uses its pattern memory to restore Kirk on the planet. Scotty's crew pulls the lines and activate the transporter, and Kirk materializes on Cepheus... at normal He signals Spock and tells him that the transporter restores those using it to their original A volcanic eruption shake the area, disrupting the transmission dish, and Spock reports that the spiroid wave bombardment has ceased. Kirk drops the communicator, which is buried in lava, and runs for cover. In a secluded valley he finds the city of Terratin: three foot in diameter. As Kirk approaches it, he's automatically beamed back up to the Enterprise.
Kirk finds no one in the transporter room and goes to the bridge. When he gets there, he finally spots Scotty and the engineering team, at 1/16th of an inch. Scotty tells him that a transporter beam snatched up the bridge crew. Kirk has everyone move away from the consoles for their own safety and then contacts Terratin, ordering them to return his bridge crew immediately. When he gets no response, Kirk fires a beam at a rock outcropping near the city. The Mendent of Terratin immediately responds, forbidding him from destroying the city. He admits that he and his people are proud and reluctantly apologizes for their actions. The Mendent offers replacement dilithium and explains that their communication antenna was destroyed by an eruption as the Enterprise arrived. They were forced to use their planetary defense system to get the crew's attention.
The bridge crew steps forward and confirms that they are okay. Spock explains that the Terratins are the descendants of Earth colonists who named the planet "Terra Ten." The spiroid compression radiation is native to Cepheus and the colonists soon began to shrink. They were unable to operate their communications equipment and lost contact with Earth. After two centuries, their condition is now genetic and they have developed their own ways. Proud, they have never sought outside help but now they have no choice but to ask Kirk for help. Uhura points out that the Terratins had no other way to reach them, but Kirk points out that he can't help anyone on minimum power. He tells the bridge crew to gather as much dilithium as they can find and prepare for transport.
Kirk beams the crew up and they are restored to normal As they beam down and then beam up the crew to restore them to normal Spock and Scotty install the new dilithium crystals. As crewmen recover more dilithium from the colony, the Mendent asks them to tell Kirk that their destruction is imminent and confirm if they should expect death or rescue.
Once the Enterprise is repowered, Kirk has Sulu use the ship's phasers to cut the Terratin city free of the planetary surface. They then beam it up and Kirk goes to the transporter room to welcome them aboard. The Mendent thanks the Enterprise crew and names them honorary Terratins, and Kirk informs the ruler that they will drop them off at a beautiful planet with no indigenous lifeforms to endanger them.