Assistant Federation Commissioner Nancy Hedford has become ill while trying to stop a war on Epsilon Canaris III. The shuttlecraft Galileo is assigned to take her to the U.S.S. Enterprise, where she will receive treatment for the otherwise fatal Sakuro's disease.

En route, the shuttlecraft is pulled off course by a mysterious, cloud-like entity. Deposited safely on the planet Gamma Canaris N, Kirk and his party meet Zefram Cochrane, the scientist that discovered warp drive over 100 years before. But Cochrane appears young and vital, despite his age. The cloud-like creature, whom Cochrane calls the "Companion," has kept him young and handsome over the years. The Companion captured the Galileo in order to give Cochrane human companionship.

The Companion prevents Spock from repairing the disabled shuttlecraft and Kirk is worried that Nancy Hedford will die before they can get her to the U.S.S. Enterprise for treatment.

By using a translating device, Kirk discovers that the cloud entity has a female personality and is in love with Cochrane, who doesn't care for that idea at all. He's fallen in love with Nancy Hedford and agrees to help destroy the cloud creature so that they can save Nancy's life. When that attempt fails, the cloud creature enters Nancy's body, saving her life, healing her. In this way, the Companion can know human love with Cochrane and Nancy Hedford's life can be saved. With the Companion no longer holding him on the planet, Cochrane is free to leave, but decides to remain with what is now Nancy/Companion. As the landing party departs, Cochrane and his new mate contemplate children and a normal life span.