How many crewmembers of the starship Enterprise does it take to change a light bulb?
Seven
While transporting a Federation ambassador to an important conference, a light bulb in engineering burns out. Scotty complains that he can’t see to tend his engines with the lights out, so Kirk diverts course to the planet Alpha Gamma Delta Hydra Epsilon IV to find a replacement. The ambassador complains but Kirk overrules him and continues to the planet.
Once there, Kirk, Spock, McCoy and two red-shirted security officers beam down to the planet. After wandering around a rocky canyon for a bit, they find a native temple dedicated to the god Watt and filled with light bulbs. They start to collect some of the bulbs but are surprised by several of the natives. There is a fight, the two security officers are killed and the others are taken prisoner.
Meanwhile, in orbit, Sulu detects a Klingon warship approaching the planet. Unable to raise the landing party and unwilling to risk the ambassador, Scotty orders the Enterprise to leave orbit.
On the planet, Kirk, Spock and McCoy are brought before the village medicine man who orders the three to be executed for defiling the temple. However, before the order can be carried out, the village chieftain arrives and stops the execution. The medicine man and the chief argue, with the medicine man arguing that the three are somehow responsible for the disease affecting the chief’s daughter. In the end, it is decided that Kirk and the others will be locked in a hut overnight and executed in the morning.
Back on the Enterprise, the ambassador argues with Scotty, demanding to be taken directly to the conference. When Scotty refuses he invokes a little-known Federation regulation which allows him to take control of the Enterprise. He orders the ship to head directly to his destination at maximum speed, refusing to change his order even when it is pointed out that the course will take them directly through the Romulan Neutral Zone. With no choice, Sulu sets course for the conference.
That evening, on the planet, the chief’s daughter visits the prisoners to beg for her life. Kirk convinces her of their innocence and McCoy is able to examine her, learning that she is suffering from Rigellian Fever, which should be unknown on this planet. Kirk asks for her help and, as she has fallen in love with him, she agrees. Spock uses his Vulcan Nerve Pinch on the guard and they escape. The chief’s daughter tells them that their equipment has been taken to the medicine man’s hut and leads them that way.
By this time the Enterprise has entered the Neutral Zone and is surprised by several Romulan Birds of Prey. The ambassador panics and first orders the Enterprise to attack the Romulans then orders a self-destruct. Scotty relieves him of command and comes up with a scheme involving the transporter, the deflector dish and some gasses vented from the engines to convince the Romulans that the Enterprise is about to explode. The Romulans back off and Sulu is able to perform a high-speed evasive maneuver that gets them away from the Romulans and out of the Neutral Zone. The Enterprise heads back to the planet.
Kirk, Spock, McCoy and the chief’s daughter reach the medicine man’s hut and start searching it. To their surprise they not only find their equipment but also find a radio of Klingon design. They also find several crates of plants that McCoy realizes have great medicinal value. Kirk realizes that the Klingons are supporting the medicine man against the chief in exchange for rights to the medicinal plants.
The medicine man and his followers suddenly arrive and find Kirk and the others. The medicine man orders his guard to attack Kirk. They fight and after a rough start Kirk is eventually able to defeat the guard, though he does lose his shirt in the fight. The medicine man is about to kill Kirk when the chief suddenly arrives, having been brought there by his daughter who had slipped away during the fight. Since his daughter had been cured by McCoy he now believes Kirk and the others. He initially orders the medicine man to be executed but Kirk is able to convince him that the medicine man will change.
In gratitude, the chief gives Kirk and the others all the light bulbs they can carry. Kirk contacts the Enterprise, which has by now returned to orbit, and requests that the landing party be beamed up. As Scotty prepares to do so, the ambassador pulls him to one side and apologizes for his actions. He and Scotty agree to say nothing about what happened.
The ambassador beams down to the planet and is able to sign a treaty between the Federation and the natives for access to the medicinal plants. In the meantime, Scotty is able to install one of the new light bulbs in engineering. There is a tense moment when the bulb is turned on as it is feared that the alien bulb may not work with the Enterprise systems but after a few seconds engineering is again lit.
On the bridge, Spock asks if they have not violated the Prime Directive by interfering with the natives. Kirk says they have not, as no one should be ruled by light bulbs. McCoy quips that they helped the natives see the light. Spock looks confused but everyone else laughs as the Enterprise resumes its five year mission…