The TARDIS is attacked by a powerful force whilst in flight. The entire console room is distorting and the Sixth Doctor and Melanie Bush are both knocked unconscious. The ship then materialises on the planet Lakertya as a Lakertyan, Ikona, looks on. The TARDIS' doors open and the renegade Time Lady, the Rani (Kate O'Mara) enters. She tells her unseen companion to "leave the girl" and that the Doctor was "the man I want." As she leaves, a lumbering, hair-covered creature, Urak, enters and and turns the Doctor's prone body over. At this moment, the Doctor undergoes regeneration.
At her Lakertya base, the Seventh Doctor regains consciousness in the Rani’s laboratory, where she is supervising the incarceration of a kidnapped Albert Einstein. The Doctor's mental state is caught in his former persona, and he recalls his last conversation immediately before he was forced to regenerate. He overcomes his temporary disorientation and recognises the Rani. Examining her equipment, he sees an asteroid which he identifies as being composed of strange matter. The Rani refuses to discuss her "ethics" with him and pulls a gun on him; he tries to run, but trips. The Rani's assistant Sarn rushes to help the Doctor; when the Rani threatens to punish her she escapes, but the Doctor is stunned and captured.
Inside the TARDIS, Ikona rescues Mel, who soon regains consciousness and escapes, only to run into Sarn. In her panic, Sarn traps herself inside a transparent bubble, which explodes and kills her.
The Rani orders Urak to reset the trap while she injects the Doctor with an amnesia drug. When the Doctor comes round, the Rani pretends to be Mel, asking him to repair a faulty machine in her laboratory. Ikona recaptures Mel, believing her to be in league with the Rani. She saves him from another of the bubble traps, convincing him that she is friendly.
Puzzled and confused, the Doctor refuses to continue work. He and the Rani return to his TARDIS to fetch a radiation wave meter. There, the Doctor changes his clothes, choosing a new outfit for himself.
Mel sees Urak and stumbles into a bubble trap. Ikona rescues her and they retrieve some weapons and head for the Rani’s fortress. Ikona meets Sarn’s mother Faroon (Wanda Ventham). Faroon discovers her daughter’s skeleton and goes to speak with the Rani's other assistant, Beyus.
The Rani is captured by Urak who mistakes her for Mel. Mel meanwhile makes her way into the Rani’s control room where the Doctor believes her to be the Rani. The two travellers eventually identify one another by feeling each other’s pulses. Beyus tells the Doctor the combination to unlock the control room door – it is 953, the Rani's age (also the Doctor's).
Outside the control room, Mel finds the cabinets containing Einstein and other kidnapped geniuses and sees that a space is reserved for the Doctor. The Rani returns; the Doctor hides in a dark Tetrap eyrie. The Rani locks the gate behind him and he finds himself surrounded by awaking Tetraps.
Beyus rescues the Doctor and tells him to go to the Lakertyan’s Centre of Leisure, where the reason for Beyus' obedience to the Rani will be revealed. The Doctor takes a micro-thermistor from the Rani’s machine and leaves.
Mel is captured by the Tetraps and paralysed by their sting. The Rani sends the Doctor a message that she will exchange Mel for the stolen micro-thermistor.
At the Centre of Leisure, the Doctor and Ikona find that the Lakertyan people are indolent and apathetic. There is a new globe-like device suspended from the Centre, but no one will tell Ikona its purpose. The Rani, using remote control, suddenly stops the globe from spinning and killer insects emerge from it. Everyone runs out of the Centre.
The Doctor agrees to the proposed exchange, but The Rani tricks him with a holographic projection of Mel. The Doctor reinserts the micro-thermistor in her machine, but the combined brain power of the kidnapped geniuses is still not sufficient for her purposes. Urak suggests that she link her own brain in. She refuses and orders that the Doctor’s cabinet be prepared.
The Doctor notes that the Rani has a fixed trajectory rocket launcher and realises that she must be working to meet a specific deadline. Ikona distracts the Tetrap guarding the entrance to the Rani’s fortress and the Doctor enters. He is caught by Urak, paralysed and placed in his cabinet. The Rani then enters a sealed room, followed by Mel; inside is a massive brain. With the Doctor’s input, the brain is able to start carrying out the desired calculations. Urak and the other Tetraps leave the fortress to punish some of the Lakertyans by putting control anklets on them which will kill them if they rebel.
The Rani finds that the Doctor is confusing the brain and orders him disconnected. The Doctor jumps from his cabinet, and he and Mel then trap the Rani inside it. In the control room, the Doctor finds that the Rani’s rocket is intended to strike the asteroid of strange matter. The Rani is using the brain to come up with a lightweight substitute for strange matter in order to detonate the asteroid.
The Rani escapes from the cabinet and explains her plan to the Doctor and Mel. She is trying to create a time manipulator, a cerebral mass capable of dominating and controlling time anywhere in the cosmos, at the expense of all life on the planet. Urak overhears all this. The Doctor gives the brain the correct formula and it devises loyhargil, the required substance. As the production of loyhargil starts in the Rani’s laboratory, the Doctor and Mel escape from the fortress.
The Doctor helps remove the control devices from the Lakertyans, then returns to the fortress and places them around the brain. Beyus stays to complete this task as the Doctor, Mel and Faroon escape. The Doctor confronts the Rani, who detonates the devices. The brain nevertheless completes its countdown and the rocket launches, but because of the Doctor’s interference, it misses the asteroid.
The Rani escapes to her TARDIS, but it has been commandeered by the Tetraps who take her prisoner. Urak tells her they will take her to their home world where she can help them overcome their "plasma needs".
The Doctor takes all the captured geniuses on board the TARDIS so that he can return them home. He also gives the Lakertyans the antidote to the killer insects, but Ikona pours it away as he believes they should solve their own problems from now on.
Doctor Sylvester McCoy (Seventh Doctor)
Companion Bonnie Langford (Melanie Bush)
Kate O'Mara — The Rani
Mark Greenstreet — Ikona
Donald Pickering — Beyus
Wanda Ventham — Faroon
Karen Clegg — Sarn
Richard Gauntlett — Urak
John Segal — Lanisha
Peter Tuddenham, Jacki Webb — Special Voices
Writer Pip and Jane Baker
Director Andrew Morgan
Script editor Andrew Cartmel
Producer John Nathan-Turner
Executive producer(s) None
Production code 7D
Series Season 24
Length 4 episodes, 25 minutes each
Originally broadcast September 7–September 28, 1987