Star Trek: The Naked Time

The Enterprise is orbiting the planet Psi 2000. On the surface are Federation scientists set to observe the planet's impending disintegration and final destruction. Lieutenant Commander Spock and Lieutenant Junior Grade Joe Tormolen beam down in environmental suits to a frozen-covered science laboratory and soon discover the dead bodies of the lab's scientists. Many of the bodies are found dead in the most unusual of circumstances -like someone naked in the shower. Meanwhile, Tormolen carelessly removes one of his gloves to scratch his nose, unknowingly exposing himself to a substance that jumps on his hand. Ultimately, the landing party returns to the ship for decontamination and further examination by Doctor McCoy in Sickbay. Tormolen's suddenly expresses anguish over the horrifying death scenes he witnessed on the planet, something that wouldn't have phased him as easily before the incident on the planet. He is answered with an order from the Captain Kirk to rest. 
Later in the briefing room, the Captain and his senior staff discuss the possible causes of the madness that drove the scientists to their deaths. Concerned about the planet's disintegration and crew efficiency needed for a standard orbit, Kirk asks his staff if the incident on Psi 2000 could duplicate itself aboard the Enterprise. Spock admits to limitations in their sensors, but Scotty is confident that the ship will be able to handle the extra stresses, as long as the bridge crew isn't affected in the same way as the scientists on the planet. Soon, the beginning stages of the planet's disintegration occur. 
Later in the officer's mess, Tormolen is sweating, agitated by a pain in his hand. Nearby, Lieutenant Sulu is having a pleasant conversation with Lieutenant Kevin Riley about the art of fencing. Sulu and Riley's efforts to have Tormolen join the conversation trigger an emotional outburst from him. Tormolen suddenly brandishes his table knife and rambles on about the futility of humans colonizing space, shouting, "We have no business being out here, NO BUSINESS!" His emotional state quickly turns and he points the table knife on himself. Sulu and Riley try to calm him down and force the knife away from him. During their struggle with Tormolen, Joe falls on his knife and impales himself. Later in Sickbay, McCoy and Nurse Chapel fail to save Tormolen's life. In his report to the Captain, McCoy states that the cause of death had simply been Tormolen's lost of will to live. 
The planet's breakup continues, and so do some of the crew's emotional states. Sulu and Riley, now at their bridge stations and showing signs of the infection, are lax in making course corrections. While Spock is busy at his science station, Sulu abandons the helm, leaves the bridge, and heads to the gym for some fencing. Back on the bridge, Riley now infected, acts insubordinate to Spock, who orders him to Sickbay. Reporting briefly to Sickbay as ordered, Riley proceeds to flirt with Nurse Chapel, infecting her. Sulu, now fantasizing about being a 18th century musketeer, roams the decks of the ship with his sword and frightens off two crewmen. He then heads to the bridge and "rescues" Uhura. Spock finally knocks him out with his Vulcan nerve pinch. 
The planet convulses, but the helm is unable to respond. A call to engineering is answered by Kevin Thomas Riley, who has expelled Scotty and crew and begins to sing and broadcast Irish songs. Without power, the Enterprise is twenty minutes from destruction, and the affliction continues to spread throughout the crew. 
Meanwhile, Spock tours the ship, urging Scotty to expedite his efforts in re-taking engineering, ordering an infected crewman to stop romantically serenading Yeoman Rand, and checking on McCoy's progress. When Spock enters Sickbay, he finds himself alone with Chapel, who confesses her love for Spock, infecting him. Ignoring repeated hails from the bridge, Spock's emotional state quickly weakens, so he secludes himself in the briefing room, but not before suddenly breaking down and crying. 
Engineering is retaken, but Scotty discovers that Riley has completely turned off the ship's engines. This requires a normal restart of at least thirty minutes. Furthermore, the ship is now spiraling down towards the planet and is only minutes from burning up in the atmosphere, unless they can restart the engines quickly. Scotty informs Kirk that suddenly starting the engines cold would result in a massive explosion of the ship, because matter and anti-matter can't be mixed cold. However, Kirk suggests to Scotty that a cold-restart with a controlled matter-antimatter implosion in balanced engines might be tried. Since this controlled implosion requires precise calculations, Spock's science knowledge is urgently required. But, Spock still can't be found. Spock tries to sober himself back to reality by viewing an old photo of his bonded betrothed wife on Vulcan; T'Pring. Meanwhile, McCoy has discovered a cure for the affliction. 
Finally, Kirk discovers Spock alone in the briefing room in a sad demeanor, regretting his inexperience in expressing love. Kirk slaps him on the face, to which Spock admits to feeling shame over his friendship with the Captain. Kirk strikes him again, so Spock responds in kind, sending Kirk backwards flying over a table. Kirk, now infected, begins to display his suppressed emotions. He admits to Spock that he has "a beautiful Yeoman" and advises Spock that he's better off without love, and raps over his real true love, the Enterprise, and the price she exacts. Spock slowly returns to normal, who then proceeds to help a non-infected Scotty with a restart the ship's engines. Kirk is also slowly returning to normal and enters the turbolift to the bridge, Alone in the lift he quietly talks to his ship and raps, "I'll never lose you... never." 
Entering the bridge, a semi-aware Kirk takes the center seat. His orders are confusing, but a cured Sulu is able to navigate an escape from orbit. While still in the center seat and fogged from the disease, Kirk slowly reaches out a hand to his beautiful Yeoman, Janice Rand, standing next him staring at the viewscreen, but knows he can't touch but for duty. Meanwhile, Spock and Scotty have finished the procedures on the checklist for restarting the engines cold. Finally, Kirk gives the order for restart. The controlled implosion is successful with an unexpected result -sending the Enterprise three days back in time. Spock ponders the new scientific possibilities that have been uncovered, but Kirk decides to orders a course ahead to the nearest Starbase.