Picard, Troi, and La Forge are taken captive. Geordi's VISOR allows him to see a carrier wave being beamed from Lore to Data and they hypothesize that this is the source of Data's emotions and Lore's control over Data. For this reason Lore orders Geordi's VISOR removed. In orbit, the Borg ship is detected and Beverly orders the away teams on the planet to be beamed back aboard. However there isn't enough time to get them all, so Riker orders Crusher to leave and come back only when it's safe to do so. Rather than leave the system, Beverly orders the crew to take the ship into the sun. Using the technology developed by Dr. Reyga, they modify the shields to allow them to get closer to the sun than the Borg can go. They use the ship's phasers to trigger an eruption on the sun's surface which engulfs the Borg ship, destroying it.
On the planet, Lore orders Data to perform an experiment on Geordi's brain - an irreversible procedure with a "60% chance" of being lethal. Geordi tries pleading with Data, who ignores him and continues setting up the process. In their prison cell, the away team constructs a device which they believe will reactivate Data's moral subroutines, in the hopes that he will question his unethical actions, as well as the intentions of his brother.
Meanwhile, Riker and Worf encounter Hugh, who tells them that Lore is the leader of this Borg group. He says that at one time Lore's help was necessary, but that he has since destroyed many Borg through brutal experimentation. Hugh's group are "rebel" Borg, wanting to remove Lore from power.
The away team manages to reactivate Data's ethical programming just as Data is about to start the irreversible part of the experiment. Geordi pleads with Data, asking him to check his conscience. Data falters, claims that there are anomalies in the experiment and postpones it.
Lore begins to doubt Data's devotion, and attempts to strengthen control by threatening to remove the emotions he has provided. Data appears to have been cowed, but Lore remains suspicious, and orders Data to prove his loyalty... by killing Picard. Data refuses, as the rebooting of his morality subroutines is complete. Two Borg seize Data and Lore is about to execute his "own, dear brother", when Riker and Worf arrive, accompanied by Hugh and some of his rebel Borg. Battle commences and in the ensuing confusion, Lore flees, pursued by Data. In their ensuing confrontation, Lore attempts to talk Data into escaping with him. Unswayed, Data shoots him with a phaser then deactivates him.
In the aftermath, Hugh appears to have become leader of the Borg group.
The Enterprise is seen returning to Federation space. Data reports that Lore has been disassembled and he now intends to destroy the emotion chip, as it is "too dangerous", citing the harm he has inflicted under its influence. However Geordi intervenes, and advises him to keep the chip until he is ready. (The chip would eventually be implanted into Data during the course of the film Star Trek Generations.)