In "The Doomsday Machine," an Original Series episode, Captain Kirk and crew must somehow stop a planet-killing machine before it reaches large civilizations. They fail, and everyone dies. Just kidding.