The Doctor, Romana, and K9 arrive in Cornwall, where they meet Professor Emilia Rumford (Beatrix Lehmann) and Vivien Fay (Susan Engel). They are studying the Nine Traveling Stones in Boscombe Moor. They are interrupted by Druids who worship the Cailleach, goddess of war and magic. Leading the sect is De Vries (Nicholas McArdle).
The worshippers are killed by mobile stones which the Doctor thinks are aliens who feed on blood. He and Emilia find evidence that Vivien is hundreds of years old, at least. Romana catches her awakening more stones with blood, and Vivien transports her to a spacecraft in hyperspace. Vivien tells the Doctor and Emilia that Romana will be safe, then she disappears. The stones, the Doctor realizes, are Ogri, from the planet Ogros.
The Doctor builds a projector to cross into hyperspace, leaving Emilia and K9 to guard it. The spacecraft is a prison ship. He mistakenly releases two floating lights called Megara. They are justice machines, and they accuse the Doctor of breaking a seal on the ship, for which the punishment is death. Vivien discovers that the Doctor is on the ship and returns to Earth, awakening one of the Ogri and damaging the Doctor’s projector. She and the Ogri return to the ship for the Doctor’s trial. K9 helps Emilia to repair the projector. They bring back Romana and an Ogri chases them to Vivien’s cottage. Romana finds proof that Vivien is an alien and returns with it to the ship.
The Doctor learns that the Megara are searching for a criminal named Cessair--though they don’t know what the criminal looks like—who has stolen the powerful Seal of the planet Diplos. The Doctor suspects that Vivien is this Cessair. The Megara decide that the Doctor is guilty and fire an energy weapon at him, but he drags Vivien into the shot, and she is knocked out. The Megara scan Vivien to see if they have harmed her and discover that she is Cessair. Romana arrives with more evidence. The Megara send them all to Earth and turn Vivien into a standing stone, but the Doctor sees that she is wearing the stolen Great Seal and grabs it, because it is the third Key to Time they have been searching for.
The story was filmed at the Rollright Stones, a megalithic site in Oxfordshire. The role of Vivien was turned down by Honor Blackman because it did not have the best lines. Beatrix Lehmann as Emilia Rumford is another in a long line of elderly ladies brilliantly playing eccentric Professors in Doctor Who stories. Apparently, she had a habit of making up dialogue as she went along, forcing Tom Baker to scramble to catch up. John Leeson was providing the voice of K9 through a two-way radio from a nearby van. On a break, Tom Baker took out the Times Crossword puzzle, as did Leeson in the van, and passers-by were treated to K9 providing help to Baker with the crossword. This was the 100th Doctor Who serial and the 15th anniversary of the show, so a scene was written in which Romana and K9 present the Doctor with a cake to celebrate his 751st birthday, but producer Graham Williams thought it a bit too self-indulgent to be on the air. They did enjoy the cake, though.