Travelling through space, the TARDIS suffers an energy drain and crash-lands on the planet Exxilon. The Doctor and Sarah Jane Smith venture outside to investigate the cause of the interference, and become separated. The Doctor is captured by the planet's inhabitants - the savage Exxilons - but escapes. Sarah is attacked by one of the creatures in the TARDIS, and flees into the night, finding a huge white City with a flashing beacon.
When daylight arrives, the Doctor is found by a party of the Marine Space Corps; they take him to their ship, which has been stranded by a power drain. They are on an expedition to mine "Parrinium" - a mineral abundant only on Exxilon - which can cure and give immunity to a deadly space plague. The lives of at least 10 million people depend on the expedition's obtaining the Parrinium and leaving the planet within a month. They show the Doctor some photos they have taken of the nearby City - which the Exxilons worship, sacrificing anyone who ventures too close to it. Sarah does so, and is captured and taken to the Exxilons' caves to be sacrificed by their High Priest.
A ship containing four Daleks now arrives; both the Daleks' ship and their weapons have been rendered useless by the energy drain. The Daleks claim that several of their planetary colonies are suffering from plague; thus they need Parrinium for the same reason as the humans. The Daleks, the Doctor, and the humans form an uneasy alliance to obtain Parrinium and escape Exxilon. While the allies are making their way to the humans' mining dome, the Exxilons ambush them, killing a human and a Dalek and capturing the others. The prisoners are taken to the Exxilon caves where the Doctor interrupts Sarah Jane's sacrifice; therefore, he is also condemned to death. When the dual sacrifice commences, a second party of Daleks, who have replaced their energy weapons with firearms, attack in force, killing a number of Exxilons. They then force the Exxilons and humans to mine Parrinium. The Doctor and Sarah flee into underground tunnels.