Stardate 3018.2: Above the planet Pyrus 7, Kirk and Spock are waiting for a check-in report from Scotty, Sulu, and Jackson on the planet below. Jackson finally calls in but asks for a beam up repeatedly and doesn't respond to their questions. They beam him up where he collapses, dead. A man's voice speaks from Jackson's mouth, telling Kirk to leave as there's a curse on the Enterprise.
Kirk, Spock, and McCoy beam down into a fog bank, even though Spock says there's no way the weather conditions can generate fog. Spock picks up multiple life form readings on his tricorder although Uhura can't register anyone but the landing party. Static cuts them off and three spectral witches appear out of the fog, telling them to go back before fading away. Spock notes they don't register on his tricorder but picks up the life signs again. They follow them to an enormous castle where a black cat greets them. It leads them down the hallway and through a trap door where they are knocked unconscious.
The three of them wake up chained in a dungeon and conjecture someone is drawing on human ancestral memory of what terrifies them. Scotty and Sulu enter, carrying phasers, and don't respond. Sulu mindlessly frees first McCoy and then the others. As they take them out, the landing party makes a break for it… and find themselves teleported into a chamber where a bald wizard greets them. Kirk demands answers from the man, who introduces himself as Korob and wonders why they question everything and notes he is not a native of the planet. He also talks to his black cat as if it can understand him, and Spock suggests it might be a familiar.
Using a wand, Korob treats them to a meal but Kirk would rather have explanations. He summons gems as a bribe for them to leave but Kirk is unimpressed. The cat, Sylvia leaves and immediately transforms and returns as a beautiful woman. She talks about her ability to control humans and briefly entrances McCoy. Kirk grabs a phaser from Scotty and demands the rest of their weapon and some answers. Sylvia is unimpressed and holds up a small model of the Enterprise She talks about how she made a model of Jackson and "killed" it, killing Jackson for real. She dangles the Enterprise into a candle flame and give Kirk a communicator. Over Korob's objections, she heats up the model and LaSalle repots that the ship is suddenly heating up for no reason. Kirk gives up the phaser and Sylvia yields the model.
Korob asks them about their science but Kirk notices the ship will send down a security team. Korob creates a glass cube around the model, trapping the Enterprise in a force field. He sends Spock and Kirk back to the dungeon but Sylvia keeps McCoy to probe his mind. Above, LaSalle works to put a dent in the force field.
In the dungeon, Spock speculates that Korob and Sylvia can only tap into their subconscious, and don't know what is "normal" for humans. Kirk suspects that they may have some hostile intent in the galaxy. The now mindless McCoy comes back with the others and takes Kirk away. Up above, Korob argues with Sylvia about how she tortures their "subjects" but she threatens to destroy him if he crosses her.
Sylvia has Kirk left alone with her and demands more sensations. As Korob secretly looks on, Sylvia offers Kirk a place at her side and a share of her power. Kirk puts the moves on her as Korob slinks out, then asks her about the secret of her power. she talks about her "transmuter" and how her people are powerless without it. Finally she picks up that Kirk has been using her and sends him out, warning that she will destroy everything he knows.
LaSalle and Chekov start to make a dent on the force field and they relay more power from the reactors. Below, Korob frees Spock and Kirk and warns that Sylvia is out of control, but he's freed the Enterprise. He gives them their weapons but warns that Kirk's men are totally under Sylvia's control, and the strain of adapting to human form is driving her insane. They leave the dungeon but Sylvia is waiting for them as a giant cat. They figure out the phasers are drained but Korob resolves to stop her himself. They retreat back to the dungeon and seal the door, and Kirk gives Spock a boost up through the hole they fell in. Korob tries to hold Sylvia back but she knocks the door down on him, crushing him to death. Kirk grabs Korob's wand, tosses it up to Spock, then climbs up after it. McCoy, Scotty, and Sulu attack them but are easily defeated. Sylvia arrives in giant cat form as Kirk gets the wand, Korob's "transmuter," and threatens to use it against her. She returns to her human form and teleports herself and Kirk back to the main chamber. She demands the transmuter and insists she needs his needs and ambitions. Sylvia draws one of the remaining phasers and demands the transmuter… and he smashes it.
Kirk is standing on the planet's surface holding a phaser, and the rest of the landing party arrives. They spot Sylvia and Korob in their true forms as small aliens unable to survive without the transmuter. The landing party beams up and the Enterprise departs.