An unknown force pulls the TARDIS off course and onto the planet Vortis. The Doctor and Ian investigate and try to find the source whilst Barbara tends to a dis-oriented Vicki who has been affected by the natural high-frequency communications of the ant-like Zarbi monitoring the TARDIS. Vortis is a thin-atmosphere planet with natural crag-like rock formations and what appear to be pools of acid. The Doctor recognises the planet from the remains of a dead grub-like creature, however he is puzzled by the presence of moons around what should normally be a moonless planet.
Meanwhile, inside the ship, Barbara is influenced by an unknown force through her gold bracelet. This force mesmerises her and draws her outside, leaving Vicki alone in the untended TARDIS. The TARDIS begins sliding across the planet's surface, apparently being pulled by an unseen force. In her trance, Barbara walks into a trio of Menoptra – all that remains of a reconnaissance force sent to prepare the way for an invasion spearhead. They free her of the trance by removing her bracelet, and then debate what to do with her. Barbara escapes; however, she is immediately captured by the Zarbi and brainwashed through the use of a gold neck-harness. The Zarbi take her back to the Menoptra, killing one and capturing another, whilst the third escapes. The Zarbi take Barbara and a Menoptra called Hrostar to the Crater of Needles, where they are forced to gather vegetation and drop it into rivers of acid, thereby feeding the central force of the Zarbi, called the Animus.
The Doctor and Ian, having discovered the theft of the TARDIS and a trail leading away, begin tracking it. They are captured by the Zarbi and are taken to the Carsinome, where they find Vicki and the TARDIS. There they indirectly meet the Animus, who talks to the Doctor through what appears to be a mental communications device. The Animus forces the Doctor to help it track down the Menoptra invasion spearhead and the following main invasion force of the Menoptra. Ian escapes, whilst the Doctor, who has already worked out the invasion plans of the Menoptra, and Vicki try to bide their time.
Ian, trying to find Barbara, meets with a Menoptra called Vrestin, the only escapee of the Zarbi ambush. He learns from Vrestrin that the Menoptra were native to the planet Vortis along with the Zarbi, until a great evil force, the Animus, slowly and gradually took control of the planet through the mindless Zarbi. By the time the Menoptra had noticed this it was too late, and they had to flee the planet. The Menoptra fled to the moons that had been pulled into orbit around Vortis by the great evil force of the Animus – the same force that had pulled the TARDIS off course. The Zarbi soon locate Ian and Vrestin, but they manage to escape by falling down into an underground tunnel, where they meet the Optera. Ian soon realises that the Optera are descendants of the Menoptra, who had fled underground. The Optera had lost their wings through the generations and consider the Menoptra as gods, although they don't recognise Vrestin as a Menoptra. Ian and Vrestin convince the Optera to join them in fighting the Animus.
Back in the Carsinome, the Doctor accidentally releases a bit of information about the Menoptra invasion force, particularly that the spearhead plans to land at Sayo Plateau just north of the Crater of Needles. The Animus uses this information to ambush the spearhead. Barbara and Hroster escape from the Crater of Needles and try to meet up with the spearhead and also to warn them of the ineffectiveness of their weapons against the Zarbi. They fail to convince the spearhead force of the uselessness of the weapons, and the spearhead Menoptra are massacred by the Zarbi forces. Only a few survive and manage to hide in one of the Menoptra's old temples. There they try, without success, to radio the main force and warn them that their weapons are useless against the Zarbi.
Meanwhile, the Doctor works out that the Animus uses gold as a conductor to channel a mesmerising force. He counteracts this force and then uses the hidden power of his ring to control one of the Zarbi. The Doctor escapes with Vicki and his captive Zarbi, and meets up with Barbara and the Menoptra. They all devise a plan to attack the Carsinome, with the Menoptra acting as a diversionary force whilst the Doctor and Vicki try to reach the Animus with the Isop-tope device, a living-cell destructor.
The Doctor and Vicki make their way back to the Carsinome, where they are taken to the centre to see the Animus, a great spider-like creature. Here they are mesmerised and made helpless by the Animus. Meanwhile, Barbara and the Menoptra attack the Carsinome from the outside, using the Doctor's ring to control a Larvae Gun, the Zarbi's living weapon. At the same time, Ian, Vrestin and the Optera try to dig their way to the Animus from below. They all make it to the centre and to the Animus where, with a singular act of willpower, Barbara manages to use the Isop-tope device on the Animus, destroying it.
In the end, with the Zarbi free from the control of the Animus and the Menoptra and Optera free to live on Vortis, the Doctor, Ian, Barbara and Vicki leave in the TARDIS.