Stardate 3614.9: Kirk, Scotty, and McCoy are enjoying shore leave at a tavern on the planet Argelius. Scotty goes out for a walk with a belly dancer, Kara, while McCoy speculates that an injury Scotty took, caused by a woman, might leave him with psychological problems against women. Kirk and McCoy head out to find a bar when they hear a scream and find Scotty standing over the woman's corpse… with a knife in his hand.
The local administrator, Hengist from Rigel 4, questions Scotty but he doesn't remember anything. Kirk doesn't believe Scotty is guilty but Hengist isn't optimistic. The prefect, Jaris, arrives and suggests they use his wife Sybo, an empath, to determine the truth. Kirk and McCoy ask permission to use a psycho-tricorder to probe Scotty's memory and Jaris agrees. McCoy asks for a private chamber and Jaris provides a room in the basement, while noting that the locals are disturbed and they may have to close Argelius to outsiders. Lt. Karen Tracy beams down, and Scotty reacts to her. He goes with her to prepare the scan, while McCoy speculates that Scotty might have hysterical amnesia from his injury. Sybo prepares to use her powers on the knife, but it's gone. They're interrupted by a scream and go downstairs to find Scotty unconscious, and Tracy stabbed repeatedly.
While Scotty pleads amnesia and Kirk determines no one else could have entered the chamber, Hengist arrives with two men from the tavern. Tark is the dancer's father and the other is Morla, who was Mara's fiancé and was jealous of her, unusual for Argelians. Kirk believes either one of them is a suspect and they go ahead with the séance, sealing the room. As they prepare, Spock calls and suggests they beam Scotty up, but Kirk believes they should keep it on the planet.
The ritual begins and Sybo speaks of a great evil that hates women and has an unending hunger. She speaks several names, including "Redjac." The lights go out, Sybo screams, and when they lights come back on Scotty is holding Sybo… dead with a knife in her back. Afterward they wonder if Scotty is suffering from some mental injury and Kirk insists they determine if he's mentally competent by holding the trial on board the Enterprise. Jaris agrees but warns that if Scotty is found guilty, the penalty is death by slow torture.
Aboard the Enterprise the hearing continues and the computer verifies that Scotty is suffering from mental aberrations, but not sufficient to cause amnesia. The computer verifies that Scotty is telling the truth but the engineer reveals that he remembers the last murder and there was some… thing in his way, a cold stinking unreal object. The computer verifies Scotty's truthfulness when he denies the murders or doesn't remember doing so. Kirk then prepares to run a psycho-tricorder scan to verify his memories, and Hengist states he'll be satisfied if everything can be proven.
Kirk then calls Morla to the stand and he speaks of how he was angry and left the tavern after Kara left with Scotty. He claims Kara loved him but Tark says that Kara told him they fought constantly. However, Tark denies killing the women and the computer verifies he's telling the truth.
Kirk then suggests that the creature Sybo spoke of and they check the computers for the word "Redjac." The computer matches it to 19th century Earth and… Jack the Ripper.
The Argelians are skeptical that something could live that long but they note that Sybo spoke of an undying hunger. Spock suggests there are creatures that are practically immortal; and that the "killer" feeds not only on death but fear. Hengist is skeptical of the whole thing but the computer verifies it's possible and could take on physical form, while screening itself from nearby witnesses. Jaris overrides Hengist when he objects and they run a trace on similar killings. The trail leads from Earth into space in a direct line to Argelius. The other names Sybo mentioned correspond to serial killers on other planets, including Rigel 4 one solar year ago. They turn to Hengist, who came from Rigel 4, and suspect he could have committed the murders. They check the murder weapon, which came from Rigel 4. Hengist makes a break for it and Kirk hits him… and he dies. Then the lights dim and Redjac screams out through the ship's systems. The computer is non-responsive and the entity controls it.
They figure the entity will try to spread fear and terror before killing anyone, so Kirk orders tranquilizers for the entire crew. Spock puts an insoluble mathematical problem into the computer to drive the entity out while they administer tranquilizers to the crew. They go back to the briefing room where the Argelians are while the computer starts to free itself up. McCoy notes that it won't be able to do anything in a tranquilized body and then gives himself a shot. They prepare to give Jaris a shot but the entity takes him over. When they knock him out, it jumps back into Hengist, but they restrain him and give him a tranquilizer shot. They then take him to the transporter room and beam him out at widest possible dispersion, leaving it helpless to float. They have five or six hours until the tranquilizers wear off, so Spock suggests Kirk finish his shore leave. Since McCoy and Scotty are out of it, and Spock isn't interested, Kirk resigns himself to missing his shore leave.