A subspace distress signal that seems to be emanating from a Starfleet ship lures the U.S.S. Enterprise to a seemingly uninhabited moon. The last recorded Starfleet presence in the area was the disappearance of the U.S.S. Essex two centuries before, but Troi insists she senses life. A fierce storm makes beaming to the surface impossible, so Riker, Troi and Data attempt to land on the moon in a shuttlecraft. The craft crashes, Riker breaks his arm and all communication with the Enterprise is lost. Still, Troi feels something powerful, and she decides it is approaching with a particularly severe-looking storm cloud. Meanwhile, on the Enterprise, O'Brien volunteers to risk his life and transport through the storm to rescue the others. As he attempts to beam them off the moon, the cloud envelops them and strange energy rings appear around the group.

O'Brien is successful, and the Away Team returns. Once back on board however, Data, Troi and O'Brien insist the Enterprise conduct a systematic survey of a polar region of the moon — a notion Riker, Picard and the rest of the crew consider absurd. When Riker questions their reasons, the three stage a violent revolt and take command of the ship.

By holding crew members hostage, Data, Troi and O'Brien are able to force Picard to listen to their demands and change the direction of the ship. Meanwhile, Dr. Crusher and Riker determine that he was not affected because his broken arm somehow repelled whatever force inhabited the other three crew members. Later, the force reveals itself when Troi, the leader of the mutinous trio, identifies herself as Captain Bryce Shumar of the Starship Essex.

Troi explains that the spirits of the Essex crew were trapped in the magnetic currents that surround the moon when the ship disappeared two centuries before. By safely transporting their bones back to earth, Picard will free them from their spiritual imprisonment. But their violent behavior prevents Picard from believing their intentions are as friendly as they say. At the same time, Dr. Crusher decides that delivering a powerful jolt of pain to the bodies of the three may have the same effect that Riker's broken arm did and ward off the forces. Geordi and Ensign Ro work on the computer to deliver a shock to the three, but Data is not hit. The android then threatens to kill everyone in the room, and Picard weakly agrees to take them where they want to go.

As they near the moon's surface again, Riker reminds the trio that the same problems that prevented them from beaming to the surface in the first place still exist. O'Brien says he can successfully reach the moon with a Transporter Pad, and the three take off for a cargo bay with three hostages, including Picard. Once in the cargo bay, Troi reveals that her people are actually condemned spirits, the moon is a condemned penal colony, and she plans to use the bodies of the Enterprise crew members as a means of escape. Picard insists he will open the cargo bay doors and kill himself rather than risk the lives of his crew. With no other choice, the spirits leave the Enterprise for their banishment on the moon, and Troi, Data and O'Brien are returned to normal.