While scouting a planet's surface for the necessary medicine to combat a plague, Kirk, Spock, and McCoy encounter a social recluse named Flint (James Daly) who had long ago abandoned Earth and now lives alone with his enigmatic pupil and companion, an apparently young woman named Rayna Kapec (Louise Sorel). Flint subtly manufactures a series of situations that brings Kirk and Rayna together until a mutual attraction develops. Unfortunately for Kirk, Rayna's attraction to a third party was intended by Flint to awaken her senses beyond the intellectual patterns of thought—so that she and Flint could be united.
The implications of the episode are interesting: Flint isn't seeking merely a lover for companionship; he's searching for one who is also intellectual equal. He has literally built Rayna—an android—using the sum of his experiences. The story asks how useful a person is once he has outlived his own sense of purpose—and for Flint, a life of hundreds of years has produced everything from music apparently written by Brahms to artwork apparently created by da Vinci.
Admittedly, I couldn't quite understand how Kirk was so taken with Rayna so quickly (perhaps I should remind myself that this is Kirk we're talking about), but the triangular relationship that develops and ends in a tragedy (Rayna's inability to cope with her feelings causes a fatal shutdown) is best utilized in the show's final scene, where Spock uses a mind meld to relieve Kirk of his burden of grief. These are characters who feel for one another more than the plots often let on.