It is the year 2286, and an alien vessel is moving through space. The vessel is detected by the USS Saratoga, and sensor analysis reveals it to be some sort of probe. The captain of the Saratoga contacts Starfleet Command and informs them that this alien probe is apparently headed to the Terran solar system. Starfleet tells Saratoga to continue the tracking and they will analyze their transmissions and advise.
Back on Earth, the Klingon ambassador to the United Federation of Planets demands the extradition of Admiral James T. Kirk for murdering a Klingon crew and for stealing a Klingon vessel. The ambassador also denounces the failed Genesis Project as a mere weapon and the Genesis planet as a staging area from which to launch the annihilation of the Klingon race. Just then, Ambassador Sarek arrives and says that Genesis was named for creating life and not death.
He then accuses the Klingons of shedding the first blood in attempting to possess the secrets of Genesis. Sarek points out that the Klingons destroyed USS Grissom and killed Kirk's son, which the Klingon ambassador does not deny, saying they have the right to defend their race. Sarek then asks if the Klingons have the right to commit murder, which causes an uproar in the council chambers until the President calls for order.
Sarek says that he has come to speak on behalf of the accused, which the Klingon ambassador decries as a personal bias, as Sarek's son was saved by Kirk. The president tells Sarek that the council's deliberations have already concluded. He then tells the Klingon ambassador that Admiral Kirk faces nine violations of Starfleet regulations. The Klingon ambassador says that only facing Starfleet regulations is outrageous and decries that as long as Kirk lives, there will never be any peace between the Federation and the Klingon Empire.
As he and his aides storm out of the council chambers, someone in the council chambers calls the ambassador a "pompous ass." "Captain's log, stardate 8390. We're in the third month of our Vulcan exile, and it was Dr. McCoy with a fine sense of historical irony who decided on a name for our captured Klingon vessel. And like those mutineers of five hundred years ago, we too have a hard choice to make." Kirk surveys his crew and they all vote "Aye, sir."
Kirk states then to them "Let the record show that the commander and the crew of the late starship Enterprise have voted unanimously to return to Earth, to face the consequences for their actions in the rescue of their comrade, Captain Spock." Scotty tells Kirk that it'll take him one more day to get their Klingon ship, named by McCoy as the HMS Bounty, ready to go saying that while damage control is easy, reading Klingon is hard.
McCoy laments that Starfleet could have at least sent a ship to pick them up as it's bad enough to know they will be court-martialed and likely imprisoned but the worst is going home in the "Klingon flea trap." Kirk says the "Klingon flea trap" has a cloaking device which cost a lot. McCoy comments that he wishes they could cloak the stench. Kirk looks up and sees Spock standing at a cliff. Spock then walks off and goes back in a room and resumes computer testing of his mental faculties.
While the tests show Spock has regained full control of his faculties once again, he is confused when the computer asks him how he feels. Then Spock's mother enters and reminds Spock that as he is half-Human, he has feelings and the computer is aware of this. Spock says he must go to Earth with the others and offer testimony because he was there when the events occurred. Amanda asks if the good of the many outweighs the good of the one and Spock says it does.
Amanda then says that it was a mistake by his flawed, feeling, Human friends for them to sacrifice their futures because they believed that the good of the one, Spock, was more important to them. Spock says that Humans make illogical decisions. Amanda smiles and agrees. Just then, at the Neutral Zone, the probe comes close to the Saratoga. The captain orders yellow alert, but the probe begins draining the ship of all power. As the Saratoga begins to drift, the captain tries to issue a distress call to Starfleet Command.
Meanwhile, at Starfleet Command, the President asks Starfleet Admiral Cartwright for a status update and he tells the president that the probe is headed directly toward Earth and that its signal is disabling everything it contacts. According to Cartwright, two Klingon ships have been lost while two Federation starships and three smaller vessels have been neutralized. He then orders contact with the USS Yorktown and their captain says his chief engineer is trying to deploy a makeshift solar cell hoping they can generate enough power to keep themselves alive.
As the probe continues toward Earth, on Vulcan the Bounty is almost ready for launch. Kirk comes on the bridge and asks for status reports, Uhura says communications systems are ready and the communications officer as ready as she'll ever be. Sulu reports the on-board computer will now interface with the Federation memory bank. Chekov reports the cloaking device is repaired and available in all flight modes. Kirk admits to being impressed with all that work for such a short flight.
Chekov then tells Kirk since they're in an enemy vessel, he didn't want to risk being shot down on the way to their own funeral. Kirk compliments Chekov's thinking and then calls Scotty, who tells him that they are ready to go. Scotty says the dilithium resequencer has been converted into something not quite so primitive and that he has personally replaced the Klingon food packs as they were giving Scotty a sour stomach. Kirk turns and tells all who's not going to Earth that they better get off.
He then turns to Saavik, who is remaining on Vulcan, to tell her goodbye and to thank her. Saavik says that she's not had opportunity to tell Kirk how bravely David died and that he saved her and Spock and she wanted Kirk to know. Just then, Spock arrives on the bridge and Saavik wishes his journey to be free of incident. Spock tells Saavik to "Live long and prosper." Spock gets permission from Kirk to come aboard and tries unsuccessfully to get Spock to call him "Jim" as Kirk is in a command situation.
Spock also apologizes for only wearing his Vulcan robes as he seems to have misplaced his uniform. Kirk tells Spock to take his station, a move that concerns McCoy as after all that Spock's been through, he's not liable to be ready to assume such responsibilities but Kirk expresses confidence that it will all come back to him. Kirk then tells Sulu and Chekov to take them home. Sulu and Chekov gently lift the Bounty off the surface and as Saavik and Amanda watch, the Bounty heads off into the Vulcan sunset, on course for Earth.
At that time also, the probe has reached Earth and begins the process of neutralizing the Earth Spacedock before they can get the space doors open and all ships inside the dock, including Excelsior, are all neutralized and disabled. The probe then continues into Earth orbit and begins pulling water and moisture from the oceans and clouds begin gathering over the Earth as the probe continues its transmission.
Sulu reports planet Earth 1.6 hours away, and Chekov reports there are no Federation vessels on assigned patrol stations. Uhura tells Kirk that the communication channels are flooded with overlapping multiphasic transmissions sounding almost like gibberish. She asks Kirk for some time to try to sort it all out. Just then, McCoy sits next to Spock and asks if he's busy. Spock says that he is simply monitoring and that Uhura is busy.
McCoy says that it's sure nice for Spock's katra to be back in Spock's head and not his, stating that he might have carried Spock's soul but he couldn't fill Spock's shoes. When Spock doesn't understand the quip, McCoy drops it and asks if he and Spock could speak about philosophical matters such as life and death but Spock says he didn't have time on Vulcan to review philosophical disciplines. McCoy tells Spock that he's "...really gone where no man has gone before" and is amazed that Spock can't tell him what it felt like.
Spock says that they can't discuss the subject because they don't have a common frame of reference. When McCoy asks if Spock is joking, Spock defines a joke as "a story with a humorous climax." McCoy is amazed that Spock is inferring that McCoy would have to die in order to discuss Spock's insights on death. Just then Spock tells McCoy he's receiving a number of distress calls, which McCoy doesn't doubt as he gets up and walks away.
Back on Earth, the situation is worsening. Reports from all over the world pour into Starfleet Headquarters. These reports include weather conditions worsening around the planet, such as how temperatures in Juneau, Alaska were dropping and cloud cover was up to 96%. In Tokyo, Japan, all power was gone and only available from reserve banks. Both it and Leningrad had 100% cloud cover and their temperatures were decreasing rapidly. The president asks about worldwide cloud cover and a report of 78.6% comes in.
At that point, Cartwright orders a planet-wide emergency and declares red alert. Just then, the influence of the probe comes over and power begins to fade. Cartwright tells the president that even with planetary reserves, they are doomed without the sun. The president states he is well aware of that fact. Just then, Sarek enters into the command center and the president laments that there may be no way to answer the probe. Sarek comments that one cannot answer easily if you don't understand the question. Then Sarek suggests that the president issue a planetary distress signal while there still is time.
Still en route to Earth aboard the Bounty, Uhura tells Kirk that a signal is finally coming through from the Federation. Kirk tells her to put it on screen and they all watch in shock as the president tells all ships everywhere to not approach the planet Earth as the probe is causing critical damage to the Earth, almost totally ionizing the atmosphere. The president says that all power sources have failed and all Earth-orbiting starships are powerless.
The probe, according to the president, is vaporizing Earth's oceans and that everyone on Earth will not survive unless they can find a way to respond. The president warns all ships to save their energy and to save themselves and they should avoid the planet Earth at all costs. He then bids farewell and the transmission fades. A stunned Kirk and crew are amazed at what they saw and heard. After a moment, Kirk asks to hear the probe's signal and Uhura patches it through.