Donald Babinger takes a lunch break from his office. He walks down to the park to eat his sandwiches. Shortly after, he strolls over the park. For a few moments he finds himself on the moon's surface, suffocating. His death throes are completed back in the park, in the rain.
The pathologist, Dr Winterbourne, is perplexed; apart from being dead Babinger seems young and healthy. As he speaks, in the local burger bar in the shopping centre, an American astronaut, Garrett, in full lunar space suit, asks to borrow a mobile phone.
A few hundred yards away the TARDIS lands in a local car park. Amy insists on buying a parking ticket before they head into an Italian restaurant. Before they can order the Doctor has engaged in conversation with a man who turns out to be Dr Winterbourne. The Doctor is interested in the dust on Winterbourne's arm. The pathologist tells him there is more where the spaceman is, downstairs. The Doctor recognises it as moon dust and runs downstairs. They see the space-suited astronaut and three CIA men.
The Doctor takes Amy back to the TARDIS. Seconds later they are staring out at the lunar landscape while the Doctor tells Amy that a man died earlier because he was displaced briefly to the place in front of her and that an astronaut was sent, more permanently, in the other direction.
General Adam Walinski is staring at the desert around Base Hibiscus when Dr Candace Hecker tells him the pictures have arrived from Base Diana. They go to the printer in Hecker's office and look at the photograph of Becky Starmer and her dog, lying dead on the moon. She went out to give her dog a lunchtime walk around the park in the English rain and ended up dying on the moon, along with Babinger.
Later, Hecker and Walinski discuss the malfunction in the link to Base Diana: after thirty years it has mysteriously failed. Hecker says the most experienced technicians didn't understand how it worked when everything was running smoothly and have no idea how Starmer and Babinger ended up dead on the moon while Garrett appeared in the shopping mall. Agent Jennings tells them that video pictures of the bodies being recovered are coming in but after a minute delay due to their beaming in from the moon instead of through the Quantum Displacement link. While watching these pictures they notice a blue box within sight of Base Diana, a blue box that wasn't there a moment before.
Wearing space suits, the Doctor and Amy approach a man on the lunar surface. He is astonished to see them and asks if they have come from Hibiscus. The Doctor says they are from TARDIS. The astronaut leads them to the body of Becky Starmer and the astronauts recovering it. He tells them about the displacement field that allows them to walk from the Earth to the moon malfunctioning and asks if the Doctor can have it fixed before the water and air runs out in three months. They follow him back to the moon base and enter an airlock. As they take off their suits the astronaut introduces himself as Captain Jim Reeve. He comments on how new, comfortable and sleek their spacesuits are compared to his. He asks how they got to the moon now that the displacement is down. The Doctor comments that they have a portable system in a blue box and Reeve says they are bringing the box in. he adds that, apart from knowing he can walk from Texas to the moon, he has no idea how displacement works. He asks them for I.D. before they meet Colonel Devenish and the Doctor shows him his psychic paper granting them Access All Areas.
Amy and the Doctor blunder into a meeting that Devenish is having with his team. They are all perplexed by the Quantum Displacement failure and as the meeting breaks up Reeve and Major Andrea Carlisle, a severe-looking woman in her thirties, remain behind. The Major and Devenish are puzzled that the Doctor claims he can fix the problem but has no idea what Base Diana is. Amy interjects that they have never needed to know until now. Another man, Professor Charles Jackson, who has been sitting quietly in a corner, tells them he is the scientist in charge of such matters and will give them a tour.
The bases made up of large modules connected by rectangular corridors. Some is built underground. Twelve soldiers, three officers and a handful of scientists are the occupants. Their quarters take up most of the base with the rest being for storage. Jackson tells them that the base was set up in the seventies after the moon landings officially stopped. Apollo18 to Apollo 22 brought the parts until, from June 1980, it was possible to walk to the moon. Amy asks what Jackson's job is. To her surprise he replies that he researches the human mind and why some people are apparently evil. The Doctor tells her that there is another storage facility and Jackson agrees there is a place where they keep the prisoners.
The Doctor tells Amy that he knew there would be a prison facility because some time in the future he would be held there. They follow Jackson to his office which is piled with papers but also contains a tea urn. He offers the Doctor a cup of Earl Grey while explaining that there are eleven prisoners, all recidivists and re-offenders. Most are on the moon because of what they know from hacking government computers or stealing sensitive documents. The treatment on offer is experimental and angers the Doctor but Jackson simply says they must agree to differ.
Jackson then takes them down into corridors made up of pipes and cables. This is the Quantum Displacement technology. One look tells the Doctor that it seems well designed. Further talk is interrupted by Major Carlisle who tells Jackson that he has to do a process run on Nine.
Prisoner Nine is a tall, thin man. Two soldiers bring him to the processing chamber containing a chair and what looks like a CCTV camera. The prisoner is strapped into the chair while everyone retires to the Observation Room. Amy asks what happens in the processing room and the Doctor tells her that the prisoner will be bombarded with alpha waves to wash away the negative impulses in the brain. Jackson accuses the Doctor of stealing his research but the Doctor says he was only guessing. They are cut short by screams from the prisoner.
The Doctor runs to the chair to release the prisoner. The man convulses and then says, "Doctor, is that you?" before the Doctor can respond the prisoner tells him, "They are here." He tries to say that he is not a prisoner and that he set up the equipment, but Nurse Phillips sedates him with a syringe. The prisoner promptly dies.
Later, the Doctor tells Amy that the sedative was probably the final straw and that the man would have died anyway. What bothers him more is being recognised. Jackson joins them and says there was a power surge which killed the man. The Doctor is more interested in what the experiment is actually doing: he realises that it doesn't erase bad impulses, it actually wipes a mind totally clean and allows it to be over-written by, say, a terminally ill genius's mind in order to allow them to live on.
After Jackson leaves them the Doctor tells Amy that a power surge would have affected the artificial gravity, which did not happen. He tells Amy to ask Nurse Phillips about the experiments in the Processing Chamber. When she gets to sick bay Amy finds the nurse has only one patient. She is Liz Didbrook. Nurse Phillips explains that the woman is suffering from a nervous breakdown and this seems borne out by the seemingly random flow of gibberish that she speaks. When the Nurse steps away however, Amy sees that Didbrook's eyes have gone from grey to blue and that there is a sort of sense in the woman's words which hint that the meandering ideas are a distraction to hide the truth from someone who is watching.
The Doctor checks the connections and relays in the displacement technology, accompanied by Major Carlisle. He finds a junction box that is blackened and damaged. She asks if it is sabotage but the Doctor is non-committal. He tells her he can repair it and then he will have to go onto the lunar surface to re-align the receptors. She leaves him to it and he repairs the damage in an hour. Just as he is finishing Reeve arrives to tell him that Devenish will be going with him onto the surface.
Out on the surface Devenish tells the Doctor that they are speaking on a closed communication circuit. He asks if the systems have been sabotaged. The Doctor says he will know better when he finds out if the target locations have been reset. He adds that he thinks Major Carlisle dislikes him. Devenish replies that the major doesn't seem to like anyone. While they are resetting the double row of receptors Devenish tells the Doctor that Jackson has changed and he isn't sure he can be trusted. Just then, the lunar surface in front of them becomes a shimmering Texan desert. The Doctor quickly confides that the systems were definitely sabotaged.
Amy decides to follow Nurse Phillips. She overhears Phillips and Jackson saying that they are meeting Major Carlisle in the Process Chamber and hurries off to be there first. She hears Carlisle and Jackson enter, followed by Nurse Phillips carrying a syringe. There is a brief struggle then Jackson tells Phillips he has programmed a blank. He adds that Devenish and the Doctor will soon be in worse trouble outside. Jackson goes into the observation room and Phillips heads into the corridor. Amy follows her. Phillips heads down to the basement where a soldier is standing inert. She tells him, 'It's time.' He goes down into the corridors of pipes and wires with Amy trailing him. He takes a metal bar and begins smashing the controls of the displacement machinery. Amy charges at the soldier and knocks him into some live cables. He collapses, eyes blank, but the damage has been done.
Carlisle wakes up in the chair in the Process Chamber. She remembers the struggle with Jackson and the Nurse and then the syringe. She focuses on the probe in front of her and realises that something is eating her memories. Abruptly, the power goes off and she has a moment of clarity before the probe flares back into life.
The Doctor and Devenish step across into the desert and remove their helmets. Suddenly they are on the wrong side of the line and suffocating on the moon, just metres from the safety of the desert. The Doctor scrabbles forward. Abruptly he is in the desert again. The line of receptors and Devenish's body have gone. He is alone in a vast, hot and empty space. A jeep crosses the expanse and three soldiers jump out. They grab the Doctor and throw him over the bonnet of the jeep. He tells them that he has papers authorizing him to be there but he left them on the moon.
It is a long time before anyone comes along. Eventually Nurse Phillips leads the soldier away. Amy follows them to the medical centre where the nurse is bandaging the soldier's hand. He smiles at Amy and tells her he had an accident toasting a sandwich. Amy asks if he remembers what happened and he says he does. He doesn't seem to be lying.
As soon as the Doctor mentions the moon, the soldiers' demeanour changes. They put him in the jeep and drive off to retrieve his space suit. Later, at Base Hibiscus he meets General Walinski. He tells Walinski the reason that he isn't on their database is that he was an expert sent to help fix the quantum link. In fact, he had fixed it when Devenish was killed and he only survived because he can survive longer without oxygen. He says that he and his assistant went to the moon from the shopping centre where the astronaut appeared. Walinski assumes that this means he was sent by the CIA. Walinski asks why anyone would want to sabotage the link and the Doctor tells him that he thinks the Earth is being invaded.
Captain Reeve organizes a room for Amy. She asks if anything has been heard from the Doctor and Devenish but the Captain says it is probably too early. While discussing the accommodation, Reeve says that there are about twenty people on the base. Amy has a short sleep until a soldier wakes her and takes her to the communications room. There she has a comical conversation with the Doctor on Earth as the time delay wrecks their ability to talk sensibly but she does tell the Doctor and Walinski about the sabotage by the soldier and learns that the Doctor thinks aliens have hijacked the mind wipe process and are downloading themselves into the 'blanks'. Unfortunately, the whole conversation is being monitored elsewhere on the base.
Amy now realises that Liz Didbrook's ramblings make a lot more sense in the light of what the Doctor was saying. She goes to the medical centre and wakes Liz. In the patient's babble she realises that Liz sabotaged the systems in order to draw attention to the aliens. She also mentions Pod 7 and 21.17. she makes her way to Pod 7 and finds that 2117 is the code on the keypad that gives her access to the corridor. The same number opens the pod door. Inside are twenty tables, each with a soldier lying on it and each wired up to monitors.
Amy sees one of the soldiers is awake. She tries to escape but the soldier pursues her round the room until she bumps through the wires and detaches them. The soldier immediately turns his attention to resetting the equipment. The door slides open and Captain Reeve steps in. he is astonished at what he sees. The private and all of the other soldiers were meant to have returned to Earth. Amy tells him that Nurse Phillips and Professor Jackson are programming the soldiers. Reeve says they need to talk to Major Carlisle but Amy says she thinks that Carlisle is in on the plan. Reeve doubts her but agrees to work without her for now.
At Base Hibiscus, Walinski and his team are seriously impressed by the Doctor's genius at understanding the quantum displacement device. Nobody alive on Earth has any idea how it really works. However, the Doctor thinks it will take him three months to fix it unless he can get back to the moon. He makes one attempt to start the device but barely has time to drag Devenish's body from the moon to the desert before the projectors explode. It seems that all contact with the moon has been destroyed.
The Doctor rides out in a jeep with Walinski, Candace Hecker and Agent Jennings. Jennings says that he has read some files on UNIT and Torchwood. He now knows who the Doctor is (or he would if he were a good deal older). They drive out to a crater where a fully fuelled Saturn V rocket is waiting. Hecker says that secret flights - Apollos 18 to 22 - were launched from here but this final rocket was held in reserve. They say they need three astronauts but the Doctor corrects them because he is already trained. Garrett will be one of the others, now he has returned from his unexpected trip to a British shopping centre.
Reeve collects his pistol and leads Amy to Jackson's office. They tell the professor what Amy found in Pod 7 and what she knows about downloading alien intelligence into the bodies. Jackson seems unconcerned and tells Amy that Reeve's gun isn't pointing at him, but rather at her. Jackson says they are going to reprogram her but this can only be done at the precise moment that a signal arrives from his homeworld. Reeve leads her away to put her in a cell. On the way they meet Carlisle who asks what is going on. Reeve, who assumes that Carlisle has been processed, tells her that Amy has seen inside Pod 7. Carlisle pulls her gun and says that she will take Amy to the cell but Reeve wants to see her safely inside so Carlisle accompanies them.
As they reach the foyer, Carlisle pushes Amy roughly. She staggers and then realises that this is her opportunity. She starts running, unsure of what to do until Carlisle shouts a warning that if she presses the evacuation alarm it will open all the doors and release all of the prisoners. Amy does so, setting off alarms and releasing doors all over the base. Thin, emaciated prisoners shuffle out of their cells towards her.
Twenty four hours after their trip to the crater, the Doctor is aboard the Apollo mission blasting off to the moon. Their journey should take eighteen hours but several hours in a mysterious radio signal is received. Pat Ashton, the third man on the ship with the Doctor and Garrett, wonders where it came from but the Doctor says it is extraterrestrial in origin. Then, Garrett says the message was for him. His eyes have turned grey and his voice has lost all expression. His foot stamps through the console, setting off explosions. The Doctor floats free and tries to restrain him. Garrett picks up a heavy spanner and chases the Doctor into the LEM. He launches himself at the Doctor but misses, crashing into the thin walls of the craft. He bursts through and is sucked out into space. The Doctor braces himself, then regains the linkway and seals the door.
The Doctor lands the LEM on the moon and crosses to Base Diana. He enters through a small airlock. When he enters the base proper only Amy is waiting for him. She tells him that the prisoners rioted after she let them out but they were soon rounded up. She used the confusion to hide out until the Doctor arrived. She also tells him that the aliens call themselves Talerians. This makes sense to the Doctor. He says he can use his screwdriver to jam the signal and therefore stop any more Talerians coming through. Then he tells her that he will blow up the base and kill the lot. When Amy agrees to this plan the Doctor doesn't seem surprised. She tells him she can lead him to the Communications Room but on the way he says he can tell by her grey expressionless eyes that this is not their real destination. He says he knows that she has been taken over. Someone claps and Amy's head slumps forward. Reeve and Jackson are behind the Doctor, gun at the ready. Carlisle joins them. They say he can't jam the signal but he says that was never his plan. He asks where Amy's personality is but they say it has been wiped forever.
Reeve and Jackson leave Carlisle to lock the Doctor up. He tells her that her brown eyes show she isn't really a Talerian and wonders if they are colour blind. She says that her reprogramming failed when the power cut happened but she has a Talerian trapped in her head. The Doctor uses his screwdriver to wake Amy up enough to follow simple instructions and then they all head off to the main computer facility. Carlisle says that most of the soldiers have been processed but many of them don't realise that they have. This makes it difficult for them to know who to trust. This does suggest that the original personalities are being kept stored in order to reload them when necessary.
They are halted by a technician with a gun but Amy walks into him and then down the corridor. Distracted, the technician, Gregman, is knocked out by Carlisle. She wonders if Amy did that on purpose because she ignored a clear command to halt. They pass through a door and down some stairs to where the computer facility is stored in the bedrock beneath the base. The base has been built over a giant underground lake which is used for drinking and hygiene as well as data storage using molecules of water.
When Gregman wakes up his Talerian personality kicks in and he follows the corridor to the door down underground. The code won't work but he realises that this is just proof that the Doctor has been that way. He hurries off to Jackson.
The Doctor accesses the records and locates the location of Amy's personality. It is stored in water in a small phial which he extracts from a drawer carefully. Then comes the sound of banging on the door above. They hide behind a line of storage banks as several people come down the stairs. The Doctor gives Amy her phial and tells her to put it somewhere safe but seconds later it clatters to the floor, the stopper removed. It is empty. The Doctor looks at several puddles of condensation on the floor and wonders which might be Amy. Just then she pulls Carlisle's gun from its holster as Reeve finds them. She tells Reeve that she has to trick the Doctor and take him for processing. The Doctor tells Reeve that this proves their techniques are fallible but Reeve says it just a sign of the program adapting to circumstances. Amy leads the Doctor towards the processing chamber while he wonders if her self-will is reasserting itself.
As they make their way up the stairs, Amy tells the Doctor that she drank the water from the phial. She winks, tells him and the Major to run and then shoots out one of the lights. The Doctor and Carlisle escape but Amy is dragged back. The Doctor is delighted that drinking the water gave Amy her personality back. The Doctor now has a plan. They hide in a nearby store room until the party from the stairs passes them.
The Doctor sends Carlisle to the control room so that she can access the fire suppression system. He returns to the computer facility. When he is caught by Reeve and some soldiers they see that he has vented the gas from the fire systems and replaced it with water. He whips out his sonic screwdriver and sets off the sprinklers. Reeve pulls the trigger of his gun as water cascades down.
Carlisle finds Amy in the Process Chamber and releases her from the chair. Every one of the soldiers has slumped into sleep. Only Jackson seems to be running around freely. They go back to find the Doctor. He is holding the unconscious figure of Reeve. He tells them that Reeve shot and missed. Around them stand several sleeping soldiers. The Doctor says that before he was caught he put the personalities of all the reprogrammed staff into the water in the sprinkler system. Their minds are now trying to readapt to their original patterns.
When Reeve wakes up he demands to know who the Doctor is. The Doctor asks him what he remembers last. This turns out to be a visit to the Process Chamber with Jackson. The Doctor tells him that there is an alien invasion under way and they need his help. Amy informs him that Jackson is still moving freely. The Doctor opens a drawer and sees that Jackson's phial is missing.
A bleeping from one of the consoles tells them that Ashton, in orbit above, has a message for them. He tells them that a beam of bright light is shining on Base Diana. On a screen they see a hideous, swollen, one-eyed monster materialise in a corridor. A similar alien slams open their door and points a gun at them. A soldier, waking from unconsciousness, stares at the Talerian with horror and then charges at it with a chair. One of the chair legs passes between the plates of alien armour and the fat monster bursts, leaving a gooey pool of slime. The Doctor says that this is why they needed human bodies, their own are too fragile.
A tannoy announcement by Jackson tells the Talerians to set their weapons to stun. Carlisle says that Jackson must be in his office so the Doctor tells her to gather as many men as she can and take them to somewhere defendable like the canteen. He and Amy are going to pay a visit on Jackson.
They find the professor in his office with the alien leader Raraarg. The Doctor begins by chatting pleasantly and suggesting they drink tea like the first time they met. Jackson produces the phial containing his human self. He says destroying it would be murder before elucidating Amy and the Doctor about the Talerians increasing fragility and their need to find more robust bodies to preserve their species. The Doctor angrily snaps that it is wrong to steal someone else's body. Jackson tells him to enjoy his tea for when he has finished it he will be shot.
The Doctor makes himself a cup of tea and passes one to Jackson. Pleasantly, he offers the Talerians the chance to surrender. Jackson laughs, saying that the Talerian in him has suppressed the previous occupant. Then his eyes go blue and his voice softens slightly. He tells the Doctor it has been like looking out through the bars of a prison. The Talerian leader sees that the phial is now empty, the Doctor put the water into Jackson's tea. Jackson says goodbye and uses a Talerian gun to blow open the window. Air rushes out, Jackson with it, and the Talerian leader balloons then explodes.
Across the base the lowering pressure causes the other Talerians to explode, too. As Amy is dragged toward the window the Doctor throws a desk at the hole, blocking it and saving their lives.
The Doctor takes the TARDIS to Base Hibiscus and delivers plans for adapting a space shuttle to rescue everyone on the moon. Walinski tells him that the moon base is no longer sustainable and the Doctor says that he will be keeping an eye on things in future. Walinski says that the two of them will have to be debriefed but before this can happen they sneak into the corridor and escape in the TARDIS.