An Earth colonisation survey expedition to the beautiful jungle planet Deva Loka is being depleted as members of the survey disappear one by one. Four have now gone, leaving the remainder in state of deep stress. The leader, Sanders, relies on bombast and rules; while his deputy, Hindle, is evidently close to breaking point. Only the scientific officer, Todd, seems to deal with the situation with equanimity. She does not see the native people, the Kinda, as a threat, but rather respects their culture and is intrigued by their power of telepathy. The social structure is also curious in that women seem dominant and are the only ones with the power of voice. The humans are holding two silent males hostage for "observation". Todd believes they are more advanced than they first appear, as they possess necklaces (possibly talismanic) of the double helix of DNA, indicating a more advanced civilisation.
Elsewhere in the jungle the TARDIS crew are also under stress, especially Nyssa of Traken, who has collapsed from exhaustion. The Fifth Doctor constructs a delta wave augmenter to enable her to rest in the TARDIS while he and Adric venture deeper into the jungle. They soon find an automated total survival suit (TSS) system which activates and marches them to the Dome, the colonists' base. Sanders is a welcoming but gruff presence, further undermining Hindle at regular intervals. At this point Sanders decides to venture out into the jungle in the TSS, leaving the highly strung Hindle in charge. His will is enforced by means of the two Kinda hostages, who have forged a telepathic link with him believing their souls to have been captured in his mirror. The Doctor, Todd and Adric are immediately placed under arrest as Hindle now evinces megalomania.
Tegan faces a more metaphysical crisis. She has fallen asleep near the euphonious and soporific Windchimes, unaware of the danger of the dreaming of an unshared mind (one not engaged in telepathic activity with another humanoid). Her mind opens in a black void where she undergoes provocation and terror from a series of nightmarish characters, one of which taunts her: “You will agree to being me, sooner or later, this side of madness or the other". The spectres are a manifestation of the Mara, an evil being of the subconscious that longs for corporeal reality. Mentally tortured, she eventually agrees to become the Mara and a snake symbol passes to her own arm. When her mind returns to her body she is possessed by the Mara. In a scene reminiscent of the Book of Genesis she passes the snake symbol to the first Kinda she finds, a young man named Aris, who is the brother of one of the Kinda in the Dome. He too is transformed by evil and now finds the power of voice.
Back at the Dome, Hindle has conceived a bizarre and immolatory plan to destroy the jungle, whom he views as a threat. Adric plays along with this delusion. Hindle’s world soon starts to fall apart when first Adric 'betrays' him and then Sanders defies expectation and returns from the jungle. However Sanders is radically different from the martinet in earlier episodes. Panna, an aged female mystic of the tribe, presented him with a strange wooden box (the 'Box of Jhana') which when opened has regressed his mind back to childhood. Sanders still has the box and shows it to Hindle, who makes the Doctor open it.
The Doctor and Todd see beyond the toy inside and instead share a vision from Panna and her young ward, Karuna, who invites them to cave. The shock of the situation (accompanied by strange phenomena) allows the Doctor and Todd to slip away into the jungle where they encounter Aris dominating a group of Kinda and seemingly fulfilling a tribal prophecy that “When the Not-We come, one will arise from among We, a male with Voice who must be obeyed.” Karuna soon finds the Doctor and Todd and takes them to meet Panna in the cave from the vision, with the wise woman realising the danger of the situation now Aris has voice. She places them in a trance like state and reveals that the Mara has gained dominion on Deva Loka. The Great Wheel which turns as civilisations rise and fall has turned again and the hour is near when chaos will reign, instigated by the Mara. The vision she shares is Panna’s last act: when it is finished, she is dead.
In the Kinda world, multiple fathers are shared by children, just as multiple memories are held, and at Panna's death her life experience transfers to Karuna. She urges Todd and the Doctor to return to the Dome to prevent Aris leading an attack on it which will increase the chaos and hasten the collapse of the Kinda civilisation.
Back at the Dome Hindle, Sanders and Adric remain in a state of unreality, with the former becoming ever more demented and unbalanced, and infantile. Adric eventually escapes, and attempts to pilot the TSS but is soon confronted by Aris and the Kinda. He panics, and Aris is wounded by the machine (which responds to the mental impulses of the operator) and the Kinda scatter.
The Doctor and Todd find an emotionally wrecked Tegan near the Windchimes and conclude that she was the path of the Mara back into this world. They then find Adric and the party heads back to the Dome where Hindle has now completed the laying of explosives which will incinerate the jungle and the Dome itself: the ultimate self-defence. Todd persuades Hindle now to open the Box of Jhana, and the visions therein restore the mental balance of the 2. The two enslaved Kinda are freed when the mirror entrapping them is shattered. The Doctor then realizes the only method of combating the Mara- he realises the one thing evil cannot face is itself and so organizes the construction of a large circle of mirrors (actually reflective solar panels) in a jungle clearing. Aris is trapped within it and the snake on his arm breaks free. The Mara swells to giant proportions but then is banished back from the corporeal world to the Dark Places of the Inside.
With the threat of the Mara dissipated, and the personnel of the Dome back to more balanced selves, the Doctor, Adric and an exhausted Tegan decide to leave (as does Todd, who decides 'its all a bit green'). When they reach the TARDIS, Nyssa greets them, fully recovered.