In the year 2293, retired Captain James T. Kirk (William Shatner), Montgomery Scott (James Doohan), and Pavel Chekov (Walter Koenig) attend the maiden voyage of the Federation starship USS Enterprise-B. During the voyage, Enterprise is pressed into a rescue mission to save two El-Aurian ships, transporting survivors of the Borg annihilation, from a strange energy ribbon. Enterprise is able to save some of the refugees before their ships are destroyed, but the starship becomes trapped in the ribbon itself. Kirk goes to deflector control to alter the deflector dish, allowing Enterprise to escape, but the trailing end of the ribbon makes contact with the ship’s hull, exposing the section Kirk is in to the vacuum of space. He is presumed dead.
In 2371, the crew of the USS Enterprise-D receive a distress call from an observatory in orbit of the star Amargosa. They find that everyone, except Dr. Tolian Soran (Malcolm McDowell), has been killed by Romulans. The android Data (Brent Spiner), who recently installed a chip that enables him to experience emotions, and engineer Geordi La Forge (LeVar Burton) discover a compound called trilithium in a hidden room of the observatory. Soran appears, knocks La Forge unconscious, and, keeping a now-terrified Data at bay, launches a trilithium solar probe at Amargosa. The probe causes the star to implode, sending a shock wave toward the observatory. Soran and La Forge are transported away by a Klingon Bird of Prey belonging to the treacherous Duras sisters (Barbara March and Gwynyth Walsh), who had stolen the trilithium from the Romulans for Soran. Data is rescued just before the station is destroyed by the shock wave.
Enterprise Captain Jean-Luc Picard (Patrick Stewart) learns from a transmission that his brother Robert, and his nephew René both died in a fire at their vineyard, filling him with regret that his family line will end with him. Guinan (Whoopi Goldberg, not credited) the Enterprise bartender tells Picard more information about Soran; Soran and Guinan were among the El-Aurians rescued by the Enterprise-B in 2293. Guinan explains that Soran is obsessed with reentering the “Nexus”, the portal to which is the energy ribbon which had enveloped the El-Aurian refugee ships and briefly exposed the occupants to its nature before some were beamed out by the Enterprise-B. The Nexus, Guinan explains, is an extradimensional realm which allows those who enter to relive their greatest dream over again, whenever and however they choose, to ultimate and unending ecstasy. Guinan has learned, over time, to accept no longer being in the Nexus, but warns that Soran, insane with desire for the ecstasy of the Nexus, is “a very, very dangerous man.”
Picard and Data determine that Soran, unable to fly a ship into the ribbon due to the uncertainty that the ship will survive long enough to ensure his success, is instead altering the path of the ribbon by destroying stars, and that he will attempt to re-enter the Nexus on Veridian III by destroying its sun—and, by extension, a heavily populated planet in the system.
Upon entering the Veridian system, Enterprise makes contact with the Bird of Prey. Picard offers himself to the Duras sisters in exchange for La Forge, but insists that he be transported to Soran’s location first. La Forge is returned to the Enterprise, but his VISOR has been programmed by Soran to transmit a video signal to the Klingons. When La Forge returns to engineering, the Duras sisters are able to determine the Enterprise ’s shield frequency, and immediately attack. Enterprise destroys the Bird of Prey, but sustains critical damage: a warp-core breach is imminent and unstoppable. Commander William Riker (Jonathan Frakes) orders an evacuation to the saucer section of the ship and separates from the star drive, but the shock wave from the star drive’s destruction knocks the saucer out of control, and it crash-lands on Veridian III.
Picard, meanwhile, having failed to talk Soran out of his “horrific plan”, finds a hole in the shield surrounding Soran’s installation, but is too late to stop him from launching his missile. The collapse of the Veridian star alters the course of the Nexus ribbon as predicted, and it sweeps both Picard and Soran away. The shock wave from the star obliterates everything in the system. In the Nexus, Picard finds himself with his greatest joy: being with the “family he never had”. Upon realizing he is in the Nexus, he is confronted by an “echo” of Guinan who confirms this. After being told that he may leave whenever he chooses and go wherever and whenever he wishes, Guinan then sends him to meet Kirk, also safe in the Nexus, and preparing to propose marriage to a girl whom in reality he had left to return to Starfleet. With some difficulty, Picard convinces the initially-hesitant Kirk to return to Picard’s present and stop Soran.
After leaving the Nexus, the two arrive on Veridian III minutes before Soran launches the missile. Kirk distracts Soran long enough for Picard to lock the missile in place, causing it to explode on the launchpad and kill Soran. Kirk is mortally wounded by a fall during the encounter; as he dies, Picard assures him that he “made a difference.” Picard buries Kirk before a shuttle arrives to transport him to the wreckage of the saucer. The survivors of the Enterprise are then rescued by three starships and leave the planet.