The USS Enterprise, having survived it's battle with Khan Noonien Singh, is returning to Earth. With a few hours left in their journey, Kirk remarks in his log that there is a heavy feeling amongst the crew on the ship, having lost their science officer, Captain Spock, whom sacrificed himself to insure the Enterprise would not be destroyed by Khan. Kirk has Uhura check for a hailing signal from Starfleet but finds there isn't one. When asked by a cadet if they will receive a hero's welcome at home, Kirk thinks they will since they've "paid with their dearest blood."
In a remote area of space, a Klingon female, Valkris, waits on a small freighter for a signal from her commanding officer. Commander Kruge responds and Valkris transmits stolen data to him on the Genesis project. When asked by Kruge if she had seen the information, she replies she had.Kruge tells her that it's unfortunate that she had. With the captain of the freighter asking when he'll be paid, Kruge's ship, a Klingon Bird-of-Prey, deactivates it's cloaking device and swings into attack, blasting apart the freighter and flying off.
At Earth the Enterprise arrives at the orbiting Spacedock. While the ship docks the crew catches sight of the fleet's newest and most advanced ship, Excelsior. Sulu remarks that Excelsior has a new technology called "transwarp" drive. A skeptical Mr. Scott is scornful however Kirk scolds him gently, saying "young minds, fresh ideas." A warning alarm suddenly sounds; someone has broken into Mr. Spock's quarters which Kirk had ordered sealed. Kirk goes there himself and finds Dr. McCoy, whom appears to be suffering from mental trauma. He tells Kirk that "he left him back on Genesis" and that he has to "climb the steps of Mount Selaya" on the planet Vulcan. McCoy collapses, unconscious, and Kirk calls for the medics.
Back on Kruge's ship, he and his first officer study the Genesis materials and determine that it can be an invincible weapon. He orders a course set for the Genesis Planet.
On Earth, the crew of the Enterprise is not given a ceremonial reception. They are received by Admiral Morrow who has nothing but bad news for them: Kirk will not be allowed to return to the Genesis Planet to retrieve Spock's body. Project Genesis has become a "galactic controversy" and only the science teams will be allowed access to the planet. The crew are sworn to secrecy regarding the subject. Scotty will be transferred to the Excelsior to help with engineering development on the new ship. Worst of all, the Enterprise is to be decommissioned from service.
Onboard the USS Grissom, one of Starfleet's science vessels, Dr David Marcus and Lt. Saavik approach the Genesis planet. They scan the surface of the planet and find varying environmental conditions. They also locate the photon tube in which Spock's body was sent to the planet's surface during his funeral services. They ask permission to beam down to the planet, a request that Captain Esteban is reluctant to allow. He eventually gives them permission.
Back on Earth, at Kirk's apartment, he and his comrades share a drink honoring Spock. They also discuss McCoy's condition, who is noticeably absent and allegedly sedated in a medical facility. Kirk answers a ring at his door and is surprised to see Spock's father, the Vulcan ambassador, Sarek. Kirk asks his friends to leave and talks privately with Sarek, who is quite upset with Kirk for leaving Spock behind. Sarek speaks of Spock's Vulcan "katra", his soul, that can possibly be returned to his body. Saying that Spock wouldn't have spoken openly about his final wishes, he asks Kirk to allow a mind-meld with him. Sarek recounts Kirk's and Spock's final moments together but does not find a trace of Spock's katra. As he starts to leave, Kirk stops Sarek and tells him that even in a situation as desperate as the near-destruction of the Enterprise and Spock's efforts to prevent it, Spock would have transferred his katra to someone. Kirk reviews the ship's recording of Spock's last conversation with Dr. McCoy and sees that Spock had mind-melded with him after rendering him unconscious. Sarek tells Kirk that he must bring both McCoy and Spock to Mount Selaya on Vulcan where a ritual can be performed to restore Spock's mind to his body. Kirk says it will be difficult, but he will attempt the rescue.
On Genesis, David and Saavik find Spock's photon tube, his burial robe inside. The tube is also covered with a strange species of slimy, orange creature. David deduces that they are the evolutionary descendants of microbes present on the tube before it was sent to the planet. They also notice that the weather conditions on the planet change very rapidly. They hear a child's cry coming from a nearby cave and find a young Vulcan boy: Spock. They dress him again in his robe and contact Grissom about the discovery. However, Esteban has to cut off communication with them when Kruge's Bird-of-Prey enters the sector and attacks. Kruge's gunner fires a torpedo at Grissom, obliterating it. In a fit of anger over being denied Federation hostages, Kruge shoots his gunner with a blaster, disintegrating him. His officer, Torg, tells him that there are members of Grissom's crew on the Genesis planet below and that he'll still have a chance to take prisoners. Kruge beams down with two of his crew and they search for Saavik and David. They reach the photo tube and find huge, lamprey-like creatures, the next evolution of the small creatures David and Saavik found earlier. They pick up David and Saavik's signal on a scanner and head toward them.
On Earth, Kirk asks Admiral Morrow to allow him to return to the Genesis planet to rescue Spock. Morrow refuses, citing that Genesis is off limits and a forbidden subject. He also expresses doubt about what he calls Vulcan "mysticism". Kirk acts as though he sees Morrow's point and agrees not to attempt a voyage to Genesis. Outside the bar where he met Morrow, he finds his friends and tells them that despite Morrow's refusal, they'll go ahead with their plans. In another bar, Dr. McCoy meets with an alien pilot to arrange his own charter to Genesis. The alien, who has a booming voice, speaks loudly enough to get McCoy noticed by Federation officers that have followed him. They arrest him and put him in the brig. After making his arrangements for travel, Kirk visits McCoy in his cell and tells him about Spock's mind meld. McCoy is given a tranquilizer and Sulu, using martial arts, subdues the guards. In a transporter room in Spacedock, Uhura is present when Kirk, Sulu and McCoy arrive. She blackmails the officer she works with in the facility and beams her three friends aboard the Enterprise. On board already is Scotty, who has reworked the ship's control systems to be operated from the bridge. As they prep the ship for departure, they are hailed by Federation security to return the Enterprise, a warning that Kirk orders ignored. The ship moves out, heading directly for the dock's space doors, which remain closed. Scotty, following several attempts, is successful in opening them. allowing the Enterprise to escape. Meanwhile, on board Excelsior, Captain Styles receives orders to pursue and stop Kirk. The Enterprise goes to warp speed and streaks away. Excelsior powers up, Styles planning to use the ship's experimental "transwarp" drive to overtake the Enterprise. When he orders the transwarp drive activated, it fails, leaving Excelsior stranded outside Spacedock. On board the Enterprise, Scotty gives a handful of circuits to McCoy, admitting he'd sabotaged the other ship.
On Genesis, Saavik confronts David about the unstable nature of the planet. David admits that he used a volatile substance, "protomatter", in the Genesis Project matrix. The protomatter, may have advanced David's research, but has created a planet that is aging too rapidly to be habitable. The same effect is also advancing Spock's development and David and Saavik conclude that they must escape the planet before it destroys itself and to halt Spock's rapid aging. Spock is also experiencing a biological process called "pon farr", transformational periods that occur every seven year in which a Vulcan male develops into an adult. Saavik is able to soothe the painful process for Spock.
Later, the three are captured by Kruge and is crew. Kruge tells them of his intention to seize the Genesis research, despite David's insistence that it doesn't work. Kruge, of course, intends to use it as a weapon. The renegade commander is called back to his ship when the Enterprise arrives at Genesis. Kruge orders the cloaking device engaged and they wait for Enterprise to close the distance for attack. On board the Enterprise, Chekov loses a signal on his sensor as the Bird-of-Prey cloaks. The crew looks closely at the viewscreen and Kirk notices a shimmering distortion. As Kruge orders his ship de-cloaked and prepares to fire, Sulu identifies it and Kirk orders the firing of photon torpedoes. The Bird-of-Prey is hit directly and begins to tumble, but quickly recovers, having suffered minimal damage. Kirk orders the Enterprise's shields to be raised, but Scotty reports that the ship's systems are malfunctioning due to the unexpected battle, and before the crew can do anything else the Klingons fire a torpedo at the ship's warp engines, causing devastating damage which destroys the Enterprise's main systems, leaving the ship a lifeless hulk.
Kirk hails the Klingon ship and demands to know why they are there and why they attacked. Kruge realizes that he has the advantage, since Kirk would have just destroyed the Bird-of-Prey if the Enterprise was capable, and demands that Kirk surrender, saying that the very possession of Genesis by the Federation brands them as warlike. He also reveals that he is holding Saavik, David and Spock prisoner. He allows communication with them and Saavik tells Kirk that Spock is with them. David tells Kirk that the planet will self-destruct and that Spock must be taken off immediately. Kruge, to show his intentions are sincere, orders one of his prisoners executed. One of the Klingons draws a dagger and prepares to kill Saavik, David intervenes and fights with the Klingon, who stabs David to death. Kirk is overwhelmed by the death of his son. After a few moments, he invites Kruge to send over some of his crew to retrieve them and the Genesis materials. He orders McCoy and Sulu to the transporter room, leaving himself, Chekov and Scotty on the bridge. The three activate the Enterprise's self-destruct sequence and leave for the transporters. They beam down to the planet just as Kruge's men arrive. They find the bridge and discover the timer counting down; Kruge's order to beam them back comes too late and the Enterprise explodes. On the planet, Kirk and his friends watch as the Enterprise falls out of orbit and burns up in the Genesis atmosphere. Kirk asks "My God, Bones, what have I done?" McCoy replies "What you always do: turn death into a fighting chance at life."
Kirk and his team find Saavik and Spock just as Spock, in a rage of pain, throws one of his Klingon captors, possibly killing him. Kirk kills the second guard. Saavik tells Kirk that the Genesis effect will kill Spock if they don't leave the planet immediately. Just then Kruge beams down and holds them all at gunpoint. He orders his crew to beam up everyone but Kirk and Spock. Kruge demands Genesis; Kirk says he'll give it to him if he beams Spock up, which Kruge refuses. The two fight, hand-to-hand while the ground shifts and rumbles with earthquakes around them. They battle to the edge of a cliff, part of which falls away under Kruge's feet, leaving him dangling over a chasm of molten rock. Kirk offers to pull the Klingon up; when he does, Kruge tries to pull Kirk down with him. Kirk kicks Kruge several times in the face, finally dislodging him; Kruge falls hundreds of feet and burns up in the extreme temperatures below. Kirk runs back to Spock, grabs Kruge's communicator and, imitating the Klingon's voice, calls for beam-up. He and Spock arrive safely on the Bird-of-Prey, which has been commandeered by Kirk's comrades. The speed off as Genesis explodes.
The ship arrives on Vulcan where Sarek has made preparations at Mount Seleya. Spock's body is brought up to an altar on the mountain where the high priestess, T'Lar, awaits with Sarek. Sarek asks for the ancient ritual of "fal-tor-pan", the "refusion" of Spock's katra with his body. T'Lar warns that the ritual has "succeeded only in legend". She also warns McCoy that the ritual carries as much danger for him as it does Spock. McCoy agrees to participate.
An indeterminate amount of time passes while T'Lar performs the ceremony. The Enterprise's crew waits anxiously until McCoy walks down from the altar, apparently fine. Kirk asks Sarek if the ritual was successful, to which Sarek replies "only time will tell." Spock, clad in a white robe, descends, at first oblivious to Kirk's and his old friends' presence, however, he stops and recognizes Kirk. He asks "ship out of danger?" to which Kirk says that he saved them all. Spock, a note of recognition in his face, says "'Jim.' Your name, is 'Jim'." Kirk and his friends are overjoyed.