The Enterprise is on patrol near the Neutral Zone when they detect a damaged one-man vessel. They identify the vessel as belonging to Carter Winston, a space trader and famous philanthropist who disappeared five years ago. They beam aboard the survivor who they recognize. Ten years ago Carter had helped resolve a famine on Cerberus, where McCoy's daughter lived. Spock informs Carter that his fiancée Lt. Anne Nored is serving on the Enterprise. The first officer asks for Carter's identity tapes. When McCoy objects, Spock notes that an identity check and medical examination are standard protocol. Carter agrees.
While Spock and Kirk verify Carter's credentials, McCoy examines Carter and says he's basically normal but there are a few odd readings. Nurse Chapel brings Lt. Nored, a security officer, into Sickbay to meet with her fiancée. The medical officers give them some privacy and Anne says how relieved she is to have Carter back. Carter says that he fully intended to marry her before his last flight, but since then he's changed. He crashed on the planet Vendor and they performed surgery to save his life. Afterward, they assigned one of their people to monitor him. Nored doesn't see any change in Carter but he tells her he has to break off their engagement.
Carter goes to Kirk's quarters where the captain is preparing a report on the rescue. When Kirk isn't looking, Carter transforms into a multi-tentacles alien and gently renders Kirk unconscious with a touch. The alien then takes Kirk's form and goes to the bridge and orders a course through the Neutral Zone. When Spock questions him, Kirk says that Carter gave him information about a planet in dire straits and he detected no Romulans in the vicinity. The Enterprise heads into the Neutral Zone and Kirk leaves Spock the bridge.
The real Kirk wakes up in his quarters and goes to the bridge. He admits to Spock that he's never dozed off when making a report before. He's astonished when he learns they're in the Neutral Zone and demands to know who ordered the course change. Spock plays back the recording showing that Kirk gave the order. Kirk insists on going to Sickbay with Spock, wondering if he's suffering from a medical condition causing the apparent blackout.
Carter returns to Sickbay where McCoy starts to explain about his medical examination. The alien renders him unconscious and takes on his form. Nored comes in and asks about advice on what to do about Carter and their engagement. "McCoy" tells her that she should trust Carter and accept that he's breaking off the engagement for her own benefit. Kirk and Spock arrive and the captain asks for a medical examination. Nored leaves and "McCoy" says he'll have to do it later. Curious that McCoy would so brusquely put off the captain's health, Spock asks him if he made an error with Carter's test. "McCoy" cheerfully admits Spock could be right.
Kirk and Spock go out in the hallway and note that McCoy would never agree with Spock about his incompetence. They go back inside and discover that McCoy is unconscious in the laboratory. Kirk examines Sickbay and then takes a vial of acid and threatens an examination table, saying he plans to demonstrate how the acid works if Carter doesn't reveal himself. McCoy wonders what's going on and Kirk notes that there used to be only two examination tables in Sickbay, but now there are three. The examination table changes into the alien, and Spock realizes it's a Vendorian shapeshifter. Vendor is quarantined because the natives practice deceit as a way of life. The alien attacks them and flees down the hallway and Spock sends out a security alert to capture it.
Nored finds the Vendorian in its Carter Winston form. She realizes he must be the intruder since he's the only stranger on board the Enterprise. The alien manages to disarm her and as it flees, Nored hesitates to shoot it when she recovers her phaser. Kirk arrives and witnesses what she did, and asks why she paused. Nored admits she couldn't handle shooting an image of the man she once loved.
Two Romulan battle cruisers intercept the Enterprise and the Romulan Commander calls upon them to surrender. Kirk asks for five minutes to explain and the Romulan Commander agrees. Kirk and Spock conclude that the Vendorian is working for the Romulans and used the Carter Winston form to get on board and Kirk's form to get the Enterprise into the Neutral Zone. Kirk informs the Romulan Commander that using a Vendorian is also against the treaty and he refuses to surrender. The Romulan Commander orders an attack.
Scotty spots a crewman sabotaging the controls in Engineering. When he confronts the crewman, he's rendered unconscious. On the bridge, the crew realizes the deflector shields are done. The Vendorian tries to escape by shuttle and Kirk has Sulu manually override the controls and seal the hangar bay. Kirk goes to Engineering and Scotty explains that he saw a crewman sabotaging the shield circuitry and it will take two hours to make repairs.
Nored arrives in the hangar bay and confronts the alien in his Carter form. The Vendorian tells her that he watched over Carter after his injuries, and that the philanthropist died after a year despite the medical treatment. During that year Carter often spoke of Nored and the Vendorian took his form. As he took on Carter's form, he also acquired many of his memories and feelings, and now he loves Nored the same way that Carter did. When Nored considers her own feelings, the Vendorian reverts to its true form and asks if she can love an alien. Kirk arrives but before he can take the Vendorian captive, the Enterprise is hit by Romulan fire and the Vendorian escapes.
Back on the bridge, Kirk gets a status report and the Romulan Commander repeats his request. A deflector shield comes up and Sulu returns fire, knocking out both ships and forcing them to retreat. Kirk calls Scotty, who informs him that he never finished shield repairs. Spock concludes that the Vendorian must have taken on the form of a deflector shield. The Vendorian comes to the bridge and apologizes for its actions, explaining that it's an outcast among its people and the Romulans offered him something of value to do with his life. However, the Vendorian still shares Carter's feelings and couldn't stand to see the Enterprise and its crew threatened. Kirk tells the Vendorian it will have to stand trial but its actions on behalf of the Enterprise will be taken into account. The Vendorian reverts to its Carter form and Nored asks for permission to guard it while the return to starbase. The Vendorian is surprised at her feelings and Nored says that she wants to discuss it. As the couple leaves the bridge, McCoy notes that two Spocks would be too much and the Vulcan comments that two McCoys might just bring the ship up to normal medical efficiency.