"The Savage Curtain" by Gene Roddenberry and Arthur Heinemann (based on an original story by Roddenberry)
Enterprise is checking out a planet of magma. Weirdly, there are carbon-based life signs. However, they can't survive on the planet, so they prepare to leave. Suddenly...
Lincoln in SPAAAAAAAAAAAAAAAAAACE!
Part of the planet changes to become Earthlike. They beam Lincoln up, giving him full Presidential honors, and show him around the ship. Uhura has a lovely moment with him. For some reason even he doesn't understand, Lincoln knows about Vulcan philosophy.
Kirk and Spock go back to the planet with Lincoln. Their phasers and tricorder do not go with them and their communicators don't work. Spock is surprised to find Surak, the "father of Vulcan civilization."
A rock creature appears and says his people want to learn of "good" and "evil" and see which is stronger. The "evil" side consists of Earth warlord Colonel Green, Klingon warlord Kahless, Zora, a practitioner of unethical experiments, and Genghis Khan. (Zora and Genghis do not have their SAG cards and have no lines.)
Colonel Green offers Kirk an alliance against the rock people, but this is only a distraction for a surprise attack. Breaking away, Team Good all agree the rock people are their real enemy. To force Kirk and Spock to fight, the rock creatures disable the Enterprise and will cause it to explode in 4 hours unless "good" wins.
Surak, a dedicated pacifist, goes to Team Evil to offer peace. Soon after, Spock hears Surak crying out for help in an obvious trap. Lincoln has Kirk and Spock do a frontal attack while he sneaks in the rear to free Surak. However, Surak is already dead and Kahless had been imitating him. TE kill Lincoln and he falls at Kirk's feet.
Kirk and Spock fight TE and kill both Kahless and Green; Zora and Genghis flee. The rock creature concludes that there is nothing different between good and evil because the methods used to fight each other are the same (which is a good point, but not the one Gene's trying to make here). Kirk replies that the others fought for power while Team Good fought for the lives of others.
The rock creature fixes Enterprise and lets Kirk and Spock go back to her. Spock thinks the rock creatures transformed other beings into the historical figures, using Kirk and Spock's minds to give Lincoln and Surak personalities (where do Green's and Kahless' come from then?).
A middling episode, enlivened by Lee Bergere's Lincoln and Phillip Pine's Green. The best thing I can say about it was that it expanded the lore of the show, with both Kahless and Surak being referred to later in other Trek (was Green? I can't remember).