Commander Chakotay and Chief of Security Tuvok are found unconscious on a shuttle returning to Voyager, and are transported directly to Sickbay, where Chakotay is pronounced brain dead. Captain Janeway decides to investigate the site, a dark matter nebula, for the alien ship which the shuttle's logs record as attacking the shuttle with an energy weapon.
But the ship changes course en-route, and although the command was given from the helm, Lieutenant Paris denies making any change. Helm control is transferred to another station while the course change is investigated, but another course change is made and Paris is again identified as the culprit, this time with incontrovertible evidence. Paris is confined to Sickbay for examination.
Soon, the warp core is shut down and the main computer crashes. Chief Engineer Torres apparently made the order but has no recollection of doing so. Torres is also sent to Sickbay for examination, and the Doctor discovers a unique memory pattern occurring once in Torres' mind and twice in Paris', appearing at precisely the moments where they made actions of which they have no recollection. It becomes apparent that an entity is aboard the ship, controlling the minds of crew-members. This is reinforced by Kes, whose undeveloped psychic powers detect a presence.
To prevent the alien from taking control of herself and ordering something disastrous, Janeway decides to transfer all of the ship's command codes to the holographic Doctor, who cannot be mind-controlled. Before long, however, the alien entity has taken the Doctor offline and the command codes have been reverted back to Janeway. Janeway decides to share the codes with Tuvok, so that commands must be confirmed by both of them to take effect.
However, before this can happen, Tuvok takes control of the ship, under the influence of the alien, holding all bridge crew hostage with his phaser. He orders Voyager into the nebula, and through Tuvok the alien explains that he belongs to a group of entities called the Komar, and require neural energy - from the minds of the crew - to sustain them.
But before Voyager can fully enter the nebula, the warp core is dumped by Torres, though she has no recollection of doing so. It becomes apparent that there are two entities on board, battling with each other for control of the ship. It transpires that the entity which dumped the warp core is Chakotay, as evidenced by the fact that his authorization was given for the command.
The crew manage to overpower Tuvok while he attempts to navigate Voyager into the nebula, and the alien entity leaves the ship when a prepared magneton scan is activated. Janeway takes the ship out of the nebula, and the Doctor helps Chakotay's consciousness return to his physical mind.