UNIT is called in after a miner from the Welsh village of Llanfairfach is found dead, his skin glowing bright green. Jo joins forces with a local environment group, led by Professor Clifford Jones, while the Doctor investigates the nearby plant of a company called Global Chemicals.
They discover that the mine workings are full of giant maggots and green slime - both lethal to touch - that have been produced by chemical waste pumped from the Global plant. Stevens, the Director of Global has been taken over by the BOSS - Bimorphic Organisational Systems Supervisor - a computer with a will of its own. The BOSS plans to seize power by linking itself to every other major computer in the world, but the Doctor uses a blue crystal - a souvenir from a brief visit to the planet Metebelis 3 - to break its hold over Stevens, who then programs it to self destruct.
The maggots, on the point of pupating into giant insects, are destroyed with a type of fungus. Jo falls in love with Professor Jones and decides to leave UNIT in order to accompany him on an expedition up the Amazon - and to marry him. The Doctor gives her the blue crystal as an early wedding present.