In 2271 an unknown, cloud-like entity descends upon several Klingon vessels and destroys them. Having monitored the surprise attack, Federation space station Epsilon IX is still unable to prevent itself from becoming the next victim of this vast, mysterious energy cloud.
Meanwhile, on Vulcan, Spock is preparing to undergo the rite of Kolinahr—the achievement of total Vulcan logic—and the purging of all remaining emotion. Just then Spock's human half stirs in response to the cloud entity, interrupting his meditation and forcing the Vulcan masters to withdraw Spock's admission to their ranks.
On Earth, the U.S.S. Enterprise is readying to investigate the cloud entity. Admiral Nogura is persuaded by Admiral James T. Kirk to hand over command of the newly refit Starship Enterprise to him, superseding the vessel's present captain, Will Decker, who is unhappy with this new situation. Arriving on board the Enterprise, Kirk requests that Dr. Leonard McCoy, retired now, be recalled into service as the starship's doctor. An unchanged, blustery Dr. McCoy comes aboard and replaces Dr. Christine Chapel, who steps down out of respect. Also on board is a Deltan navigator, Ilia, who in the past was romantically involved with Will Decker. In a tragic accident, two crew members are killed in a transporter malfunction—one of which was the new Vulcan science officer, Sonak.
The accident behind them, Kirk gathers much of the crew together to deliver a mission briefing, stressing the enormous power of the entity they are faced with. After a relatively uneventful departure from Earth's drydock facilities, the U.S.S. Enterprise is suddenly faced with a giant wormhole and Kirk, unfamiliar with the design of the new vessel, almost allows the wormhole to destroy the ship. The U.S.S. Enterprise escapes, however, and is hailed by a courier vessel bearing Kirk's new science officer. Overcome with joy at seeing Spock, Kirk is soon confronted with a cold, withdrawn stranger.
The starship eventually encounters the cloud-like being, yet the entity proves to be too strong, damaging the U.S.S. Enterprise on all levels and leaving the starship stricken. When Spock attempts to communicate with the cloud by sending messages of non-aggression, a probe is triggered and sent from the center of the cloud. The crew can only watch helplessly as the probe accesses the U.S.S. Enterprise's consoles and computers, accumulating data from all parts of the ship. In his attempt to stop the violation, Spock is attacked, whereupon the probe vanishes with Ilia.
The U.S.S. Enterprise is then seized by a tractor beam and pulled inside the cloud to a large chamber. Another probe, in the form of Ilia, appears and tells them that it has been sent by "V'Ger" to study the carbon-based units that "infest" the starship. Furthermore, the crew learns that V'Ger is on its way to Earth to join with its "Creator."
In an attempt to establish contact with V'Ger, Kirk trades on Decker's past association with Ilia and assigns Decker to work with the probe. The Ilia-probe tells him that the carbon-units will be patterned for data storage.
Deciding that the best method of gathering more data about V'Ger is directly from the source, Spock dons a thrust suit and leaves the ship. His incredible visual journey to the center of the cloud culminates when Spock sees images of everything that V'Ger has experienced. Spock tries to mind-meld with the life-form, but is short-circuited and barely makes it back to the U.S.S. Enterprise. Taken to sickbay, Spock informs Kirk that his mind-meld did allow him to learn that V'Ger is lonely and seeking to learn why it was created. Furthermore, it is learned that a machine planet built the cloud and craft that house V'Ger.
V'Ger arrives at Earth and signals its Creator. When there is no response, V'Ger blasts energy bolts at the planet in an attempt to rid it of all its carbon infestations. Forced to act, Kirk tells V'Ger he knows why the Creator has not answered. The Ilia-probe, interested by Kirk's remark, says it will cease its attack when Kirk explains. But Kirk replies he will answer to no one but V'Ger itself. With some trepidation, Kirk, Spock, McCoy and Decker are lead by the Ilia-probe outside the ship to the "brain" of V'Ger...
Spoiler ! the end of the story is revealed below…
At the center of the chamber, the Starfleet officers are surprised to discover that V'Ger is in reality a twentieth century Earth robot space probe. In fact, a mounted plaque looks as though it reads "Voyager VI.".
Kirk and his crew discover that the probe disappeared into a black hole and emerged at the other end, crash landing on a planet inhabited by living machines. After repairing the probe, the machines then followed its programming—observe and transmit readings to NASA. Spock deduces that these living machines interpreted those long-ago orders as "Learn all that is learnable and return that information to the Creator.
When the U.S.S. Enterprise transmits old Voyager codes, the V'Ger transmits all of its information. Then, unexpectedly, V'Ger insists that the Creator come in person to finish the sequence. When he realizes that V'Ger wants to physically merge with its Creator, Will Decker volunteers. Decker and Ilia join together and merge into a glowing, non-corporeal entity, which disappears.
The U.S.S. Enterprise crew humbly realize that a new life form has just been created. The experience has left Spock more at peace with himself and he decides not to return to Vulcan. Kirk has command of his beloved U.S.S. Enterprise and McCoy is back in charge of sickbay. Having witnessed events suggesting that "the human adventure is just beginning," Kirk commands the starship out to space for a real shakedown cruise and future missions.
Synopsis from Star Trek Official Site.