Commander Riker, Data, and Doctor Crusher are visiting the Melona Four colony, when the Crystalline Entity suddenly appears and begins tearing up the planetary surface. Although the rapid evacuation is mostly successful, two of the colonists (including one in whom Riker expressed a possible romantic interest) die in the onslaught.
The Enterprise sets out in pursuit of the Entity, with the help of Kila Marr, who is a xenobiologist and expert on the creature. Marr does not trust Data, as she is aware that Data's brother Lore has assisted the Entity in the past. Captain Picard hopes to challenge this perception by having Data work closely with Doctor Marr.
Soon Marr reveals the source of her prejudice: her son was killed by the Entity at Omicron Theta, which was also Data's homeworld. She is initially suspicious of the android, but over time comes to understand that Data and Lore are quite different people.
Picard points out to Marr that he does not intend to kill the Entity without first attempting to communicate with it. Marr is skeptical of this approach, but she and Data are able to work out a method for talking to the Entity.
During the process of researching, Marr discovers that Data is programmed with the memories and experiences of the Omicron Theta colony, including those of her long dead son. Data tells her about how much her son admired her great work as a scientist.
The Enterprise locates the Entity and begins sending a series of graviton pulses toward it. The creature responds, and emits a signal pattern which is a clear sign of intelligence. Picard is elated at a potential first contact, but just then Marr alters the pulse to emit gravitons with a rapidly increasing amplitude, and locks the program so it cannot be stopped. The amplitude reaches a level of resonance where the Entity is shattered, which had been Marr's intended effect.
Having finally taken her long-awaited revenge, but sacrificing her career in the process, Marr is near collapse. Data takes Marr back to her quarters, where Data informs her that her son wouldn't have approved of Marr ruining her career in science by destroying the Entity:
"Your son would have been very sad right now."