Voyager discovers a planet that was the site of a major recent ecological disaster. The crew finds a set of stasis pods containing five of the aliens; two are dead from heart attacks, and of the other three, they should have been released four years ago from stasis. As the planet has recovered from the disaster, Captain Kathryn Janeway decides to release the other three, but the crew find it impossible to wake them, their brains tied to a central computer connecting all the pods. B'Elanna Torres and Harry Kim volunteer to occupy the other pods and be connected to the central computer.
They find themselves experiencing a virtual reality, a strange, dark circus-like atmosphere. A clown appears to lead the group of computer-generated characters, attempting to bring the new arrivals to play. When they refuse, the clown drags Kim to a guillotine and prepares to sever his head, but the three aliens soon appear, warning the clown that should they kill Kim, his crew mates will likely shut down the program. The clown agrees, and lets Kim go. On talking to the aliens, Torres and Kim learn that the virtual reality the computer is generating is pulling from their fears, is able to read their thoughts, and is able to induce death of the living person. Torres is able to make a deal with the clown to return out of stasis to explain the situation to Voyager, leaving Kim and the three aliens behind as hostages.
The clown, while waiting, starts to torture Kim by playing on his fear of hospitals. At one point, Kim is placed on a gurney with the clown about to slice him with a scalpel when his hand is stopped by The Doctor. The clown is bemused by the Doctor, as he cannot read his mind. The Doctor explains that Janeway has offered to provide the clown a simulated brain in exchange for Kim and the aliens. However, the clown reads the minds of his captives, who are aware that the simulated brain will not be the same as a real one, and the clown refuses. Before the Doctor returns to report to Janeway, one of the aliens provides a subtle hint of how to dismantle the computer system.
With this information, Torres begins to dismantle the simulation, the Doctor returning to keep the clown distracted. The clown discovers the deception as elements of his program are removed, and he kills the alien that gave the Doctor the hint. Janeway stops Torres before the clown takes another life. The Doctor, after communicating with the crew, informs the clown that Janeway will offer herself as a brain for the system in exchange for the remaining hostages or else she will shut down the computerized central computer stasis pod system in 1 minute even if it risks killing the hostages to stop the clown's games. The clown agrees, and soon Janeway appears in the simulation while the remaining hostages are freed. Too late, the clown realizes that Janeway too is a hologram, her mind only minimally connected to the system but not fully connected. With no living being left connected, the crew finish disabling the computer, leaving the clown frightful of the darkness as it engulfs him and the simulation of Janeway. The clown then disappears from existence.