With a routine planetary survey ahead, the Federation starship Enterprise drops Commander Riker and Chief Engineer La Forge at the Botanica Four research space station orbiting Tanuga Four to check on the progress of the work of Dr. Nel Apgar, a Tanugan who has been working towards a new promised energy source for the Federation using powerful Krieger waves. When the Enterprise returns, Riker and Apgar have exchanged harsh words, and moments after Riker transports back to the ship, the station explodes, killing Apgar. Tanugan investigator Krag asserts that Riker is a prime suspect in Dr. Apgar's death; under Tanugan law, Riker is guilty until proven innocent, and Krag demands Riker's extradition. Captain Picard requests that they hold a hearing aboard the Enterprise to determine Riker's guilt. This involves the use of a holodeck, recreating the events on the station from data logs and testimony from Riker, Dr. Apgar's wife Manua, and his research assistant, Tayna.
In the holodeck recreation, it is clear that a directed energy beam from where Riker was standing before transport struck the Krieger wave converter, destroying it and the station. As the simulations from the points of view of Riker, Manua, and Tayna play out, it is further apparent that Apgar was hostile towards Riker to begin with, fearing the Federation's presence some months earlier than planned, but was close to completing the device. However, testimony diverges afterwards; in Riker's version, Manua attempts to seduce him in the guest quarters, while Manua's viewpoint shows Riker as seducing her. In all three cases, Apgar discovers the two together, further angering him against Riker. During a recess, Riker asserts to Counselor Troi that he never seduced Manua, but she believes she too is telling the truth, and that "it is the truth as each of you remembers it".
Meanwhile, the crew of the Enterprise find highly focused pulses of radiation striking parts of the ship, putting holes through the durable wall material, and La Forge fears what would happen if this should occur in the warp reactor. The only commonality is the timing of these events, which they soon trace to be precisely in time with the Krieger wave generator on the surface, which had remained operating after the station's destruction. Picard comes to realize the truth, and prepares a new simulation on the holodeck.
With Krag, Manua, Tayna, and Riker all present, Picard demonstrates through a combination of the testimonies that Apgar was interested in financial success of completing the Krieger wave converter; he would not get this through the Federation, and Picard postulates that he in fact was trying to make it a weapon to profit from, explaining his hostility towards Riker's presence. Further, Picard suggests that Apgar had successfully built the converter; the holodeck simulation of it, also being fully functional, has been focusing the Krieger waves from the generator on the planet, resulting in the damaging radiation experienced on the ship. Picard completes his explanation by running the holodeck simulation of the moment of Riker's transport, synchronized with the planetary generator - the holodeck simulation shows that Apgar had aimed the Krieger wave generator at Riker, but when the energy beam struck him, the beam bounced off the transporter field and hit the converter, destroying it and the station. Krag agrees with the conclusion that Apgar accidentally killed himself and Riker is exonerated.