Aboard the U.S.S. Enterprise, a young boy's practical joke backfires and leaves his brother dangerously ill. Because the boy needs special treatment to survive, the ship rushes towards a nearby starbase. En route, Data begins to inexplicably malfunction, slipping into a trance-like state and altering the ship's course. He then severs the life support system on the Bridge, forcing the evacuation of the command crew, and leaving himself alone on the Bridge. He thwarts the crew's numerous efforts to regain control of the ship by speaking to the computer in Picard's voice and taking control of the U.S.S. Enterprise. The starship continues to follow his mysterious course, while the sick little boy's situation grows more desperate.
The out-of-control android maneuvers the ship toward his destination, evades three security teams by blocking them with force fields, and escapes. He arrives on a planet, and is greeted by Dr. Noonien Soong, the ancient doctor who created him. A confused Data asks Soong how he arrived on the doctor's planet. Soong explains that Data was summoned through a homing device, and ignores Data's anxious request to contact the U.S.S. Enterprise. Suddenly, a figure enters the room. It is Data's sinister brother, Lore, whom Data had defeated during a fight aboard the U.S.S. Enterprise two years earlier.
When Soong deactivates Lore to examine him, Data requests that his evil brother not be restored to life. Soong reassembles the android anyway, and explains that the homing device that summoned Data had the same effect on Lore. In an explosive outburst, Lore rails at Soong for creating Data instead of working to improve him. An apologetic Soong explains that if he had known Lore was still functional, he would have worked to correct the programming that caused him to be evil. However, his recent efforts have been to create a chip that will allow Data to feel emotion. Soong then explains that he is dying, and that this will be his final project. Lore is upset by the news and offers to help, but Soong says he only needs to rest before he begins working on Data.
Upon completing the implant, Soong learns that he has inserted the chip in Lore, who deactivated his brother while the scientist was asleep. When Soong tries to convince Lore to surrender the chip, he attacks his creator, flinging him across the room, then escaping. Meanwhile, the Enterprise crew has found a way to follow Data, and an Away Team soon reaches Soong's planet to rescue the errant android. The scientist refuses their offer to leave with them, and Data says goodbye to his creator. The starship resumes its course for Starbase 416, where the sick boy is treated and saved. The boy then reconciles with his brother, leaving Data to ponder the special bond between siblings.