"When Planets Collide"
While patrolling in the Alpho Galaxy, bridge operators aboard the U.S.S. Enterprise detect two large unidentified bodies that appeared to be on a collision course with each other. Spock informs Kirk that they are a billion miles apart and that the odds that they will collide are very small. They elect to monitor the situation and set course towards the space bodies. Five days later the objects are discovered to be planets. Scotty asks what if they should collide and concern grows as Spock announces that, "At their estimated point of contact, the results would be catastrophic, Scotty! The shock waves upon impact alone would pitch many of the Alpho planets out of orbit ... to burn in space!" After the starship receives no reply to repeated "SOS space frequency" broadcasts, Kirk decides that they must destroy one of the two hurtling planets to eliminate the collision threat.
They still detect no life and so Captain Kirk, Mr. Spock and Chief Engineer Scott beam down to place explosive hydrogen charges on the planet. Once on the planet's surface, they see a city with several tall buildings with domes atop them. Suddenly they are fired upon by a turret located atop one of these buildings. Kirk and his team are soon encased in huge transparent bubbles which have been created by the turret's beams, and they begin to float away. The four balloon-trapped men are then quickly retrieved by several armed helmeted men in purple uniforms. They are brought inside the main tower dome. Alien men burst the bubbles with weapons fire and place the trio from the Enterprise into electronic chairs. The chairs hold them in place with magnetism which works on flesh. The Federation men are subjected to electronic impulses that penetrate their minds. One of the planet's inhabitants asks, "Speak truth, aliens! Have you come to destroy what centuries of time have not been able to do? Answer!" Kirk tells them than they are space pioneers from the Starship Enterprise and that they are there to warn of their planet's imminent collision with another planet.
Impatient, Kirk grabs his own phaser and frees himself, Spock and Scott. Kirk then gets the drop on the alien man and "shouting in space Esperanto" confronts them with the facts. The alien leader finally understands and says, "How can we prevent such a catastrophe?" Kirk and Spock explain that the only hope is if the other planet is uninhabited, for if it were, it could simply be atomized. Suddenly, Kirk sees a very bright blazing light appear outside. "What's happening? Is this another trick?" The alien leader explains that the light is their artificial sun that was made many centuries ago when their own sun died - leaving their world cold. Kirk and his team are taken by elevators deep underground and are shown a sprawling underground expanse with rural farmland, rivers, cattle. The agricultural complex and a dozen other similar ones provide food for the planet Morti, supplied light via the artificial sun which shines through circular skylights.
As the Enterprise speeds to the second planet, Spock's sensors detect no life there. As they near the second doomed sphere, one reading indicates that the planet's mountainous terrain is composed of an unknown, highly active metal.
Even though the second planet looks uninhabited, Spock resists simply blowing apart the trouble-making mountains, instead, he spends some time in an attempt to chemically neutralize the pull or block it through use of another metal.
Before he knows it, Spock is sliding down a very long chute that leads deep into dark caverns. Kirk and company follow and see the alien who grabbed Spock. Spock arrives at the end of the wild slide and beholds the panorama of a technologically advanced underground city, populated by helmeted green men with scales all over their bodies, all wearing dark green pants and brown boots. Several green men approach Spock and question his presence. Just then, the alien from above arrives followed by Kirk, McCoy and Scott. Fearing a misunderstanding, Spock quickly tells them of their planet's imminent collision with another world and that he and his friends are there to help. The Federation men are held by energy rings which are projected by the rifles held by the aliens. The alien leader of the Inicrust people talks to Kirk and Spock who tell them how metal in their mountains is attracting the other globe. The alien leader believes them, saying "Release their bonds! I feared one day our unstable metals might create such terror!" Spock suggests that their carefully-placed mini atomic charges would surgically vaporize only the offending mountains, leaving the Inicrust people's deep city unaffected. Unfortunately, the strange chemistry of the mountains above is what powers the underdwellers' oxygen, light and heat producing machinery. "It has been so for a million million galaxy years!" proclaims the planet's leader. As Kirk and his sad team depart, Spock promises that there might be one very slim chance to solve the predicament.
Hours later, the Federation ship on its errand of mercy arrives at the nearly collided planets Inicrust and Morti, but only four "galaxy minutes" remain! With an extra burst of speed, the ship careens into space, depositing the wondrous glittering repulsor star chunk between the two onrushing planets. As the repelling force hits them, the twin worlds slow and then finally, "majestically they brake to a halt and hover in the skies of space."
Because they had no surface buildings, both planets were likely not harmed by the moderate earthquakes caused by their abrupt deceleration. Kirk and Spock are elated at the outcome and they drink a toast since as Kirk says, "That repellent power should hold for centuries - and perhaps by that time the Starship Enterprise will know how to really solve this problem." "Precisely my thinking, Captain," replies Spock raising his glass.