At the end of the twenty-first century, a teleportation technology called "T-Mat" has replaced all traditional forms of transport, allowing people and objects to travel instantly anywhere on Earth. Manned space exploration has ceased due to the ease of life on Earth. The Second Doctor, Jamie McCrimmon and Zoe Herriot arrive in a museum on Earth run by Professor Daniel Eldred dedicated to the obsolete technology of rockets. However, something goes amiss at the T-Mat vital relay station on the Moon and the system breaks down. With communications out, and no way to reach the Moon without T-Mat, those responsible for the system, Commander Radnor and his assistant Gia Kelly, turn to Professor Eldred to help. He has been privately building a rocket in hopes of re-igniting interest in space travel. In the absence of a space program to provide trained astronauts, the Doctor and his companions volunteer to crew the rocket.
On the moon, the relay station has been subject to a takeover. Controller Osgood has been killed sabotaging the relay system to try and prevent a takeover, and his deputy Fewsham has been pressed into assisting the invaders. Of the other technicians, Phipps is scared but defiant of the invaders while Locke actively tries to contact Earth and explain the situation, for which he is killed. The invaders are revealed as Ice Warriors, a militant Martian race, have taken control of the moonbase as a staging point for an invasion of Earth. Fewsham repairs the T-Mat link on receive mode and Miss Kelly beams through. She is put to work on repairing the full T-Mat system.
When the Doctor and his companions arrive on the moon by rocket – after a rather bumpy ride - they discover the situation and make contact with Phipps, who has evaded the invaders and is hiding in the moonbase. The Doctor accidentally reveals himself to the Ice Warriors and their leader the Ice Lord, Commander Slaar. It becomes apparent that the Ice Warriors have a deadly plan: they have seeds, which they send to various parts of Earth using T-mat, of a fungus that will multiply and suck all the oxygen from the surrounding atmosphere, making it more comfortable for the Martians but uninhabitable for humans. Once the full T-Mat relay is repaired, one seed is sent to Earth Control and explodes, killing a technician called Brent and alerting Radnor and Eldred of the danger. The seed soon creates foam which multiplies its effects and imperils more and more people. Other T-Mat terminals across the world receive more seeds with similar effects. Radnor takes a while to work out that the seeds seem to have been deposited in a pattern – all in the Northern zone, where the country is facing winter. The Ice Warriors also use T-Mat to dispatch a small advance force to seize Earth's weather control systems in London and ensure good conditions for the growth of the fungus.
Back on the moon Miss Kelly and Phipps work with Zoe and Jamie to stage diversions and attacks against the Ice Warriors. During their main assault to free the Doctor, Phipps is killed. The Ice Warriors have now retreated to their spacecraft to plan the next stage of their invasion, leaving an opportunity for most of the captives to flee the moonbase. Fewsham, however, remains behind, seemingly fearing an enquiry into his actions if he returns to Earth.
The Doctor’s first action in T-Mat control on Earth is to deduce how to stop the seed pods exploding, and works out they can be defeated using water. This explains where the Ice Warrior beamed to Earth has gone, and the Doctor tracks him down to the weather control system, where the alien has been stationed to prevent any rain fall that would be deadly to the pods. The Doctor and his allies recaptures the weather control system and summon rain, destroying the fungus which is used to the dry conditions on Mars.
Fewsham has meanwhile delivered a crushing blow to the Ice Warriors. He dupes Slaar into revealing into a live link with Earth that the main Martian invasion force is following a homing signal to the Moon, for which he is killed. But at least the Doctor now knows the full extent of the Ice Warrior plans. He decides to return to the moonbase and set a new signal for the Martian fleet from there, but knows to do so will be very dangerous. The Doctor uses T-Mat to return to the Moon and confronts Slaar while cleverly substituting the alternative signal. This draws the Martian fleet away and lures it into the Sun. Slaar moves to kill the Doctor in revenge but the arrival of Jamie in a T-Mat cubicle causes chaos, and Slaar is killed in one of the sonic beams of the last of his warriors. Jamie then kills the surviving Martian and the invasion is over. The Doctor and Jamie return to Earth and then make their goodbyes before departing in the TARDIS with Zoe.