Star Trek: The Savage Curtain

On stardate 5906.4, the USS Enterprise arrives at the volcanic planet of Excalbia to conduct a geological survey. Sensors curiously pick up the presence of carbon-based life on the surface which Mr. Spock deems impossible owing to Excalbia's extreme volcanism.
Suddenly, the Enterprise detects sensor scans from the world and receives a friendly greeting. Before a stunned bridge crew, the image of a seated Abraham Lincoln appears drifting toward them on the viewscreen. Spock indicates that the figure cannot possibly be the real historic president and that whoever is on the planet demonstrates the advanced ability to read minds and manipulate matter.
Regardless of the true identity of the being, Kirk considers Lincoln to be his personal hero and extends full presidential honors to the former leader of the United States as he transports aboard the ship. The president appears to be human, claiming to be "all too human," alluding to Nietzsche who famously treated the topic of good and evil. Lincoln has no knowledge of technology past the 1800s, however he is curiously familiar with the Vulcan philosophy of Nom (meaning "all"). Lincoln invites Kirk and Spock to accompany him down to the planet. Kirk happily accepts despite objections from Dr. McCoy and Mr. Scott. Lincoln reassures them by showing a patch of newly created "Earthlike" vegetation on the planet and informing them that they will be perfectly safe.
Once on the planet, Kirk and Spock discover their tricorder and phasers did not transport with them. They then encounter a Vulcan named Surak whom Spock remembers as "the father of Vulcan civilization". Although Surak may be Spock's personal hero, he does not believe this Surak is real and respectfully refers to him as the "Image of Surak".
Nearby, what once appeared as a boulder changes form into a rocklike being with clawed hands and several glowing eyes atop a bulbous head. The eyes flash in sync with the creature's voice, and the alien, named Yarnek, announces that the inhabitants of the planet wish to conduct an experiment to determine which opposing human philosophy is stronger — good or evil. The inhabitants of the planet, as well as the crew of the Enterprise, will be able to witness the drama but will not be allowed to interfere. The test will be a simple one of survival.
The alien then gestures to four more beings: the dangerous human warlord Colonel Green (who led a genocidal war on Earth during the 21st century), the Klingon Kahless (who spawned the Klingon Empire), a feral looking woman named Zora (who conducted brutal experiments on the primitive tribes of Tiburon), and the human barbarian Genghis Khan. The aliens then pit Kirk, Spock, Lincoln, and Surak against Green, Kahless, Zora, and Genghis in a fight to the death.
Colonel Green, notorious for attacking his enemies while in the midst of peace negotiations, starts the battle by offering Kirk a truce; stating that they should not fight for the amusement of the Excalbians. Meanwhile, Green's associates secretly ready an attack. Familiar with Green's treachery, Kirk and his companions call Green's bluff and are prepared for the surprise attack. They manage to fend off their opponents and make a run for cover.
Safe for the moment, Kirk protests the experiment and refuses to continue the battle. The Excalbians offer an incentive to fight by threatening to destroy the Enterprise in four hours if Kirk does not comply. Without another choice, Kirk and the others plan strategies and begin to manufacture primitive spears. While carving his weapon, Lincoln muses about the battlefield tactics of Ulysses S. Grant. After another round of savage rock tossing and spear throwing, Surak chooses against further hostilities and claims his position is clearly one of peace. Spock says that he will fight alongside Kirk, but also urges Kirk to let Surak attempt a negotiation. Surak plans to negotiate with their opposition despite Kirk's warnings that they cannot be trusted; Surak surmises that perhaps their belief in peace is being tested.
Surak's mind cannot be changed and he makes his way to the enemy camp to talk while Kirk and Lincoln continue their counterattack. A moment later, a scream of pain is heard in the distance followed by Surak shouting for Spock's help. Green tries to lure Kirk from hiding by taunting him about Surak's need for assistance. Spock believes it's a trick saying a Vulcan would not cry out so. Lincoln offers to sneak around and fetch Surak while Kirk and Spock cover him. When Lincoln arrives, he finds Surak dead and discovers Kahless's uncanny ability to mimic voices.
Kirk impatiently waits for Lincoln to return and runs toward him when he finally appears. Lincoln shouts a warning not to come any closer and that the enemy is planning a trap. Lincoln then collapses dead with a spear in his back. Angered, Kirk vows to finish the battle and engages the enemy head on. Kirk and Spock easily defeat them one at a time and when Green is killed the others panic and flee for their lives.
With the fight over, the Excalbian reappears and announces that while evil retreats when confronted with force, there is no great difference otherwise between the two philosophies. He does observe that the representatives of evil were motivated by a desire for power, while the "good" side seemed motivated by the requirement to protect the members of the Enterprise crew. The aliens conclude their experiment and allow Kirk and Spock to return to the Enterprise.