Kirk, Spock, and McCoy are trapped in a zoo run by a super-advanced species after beaming down to a planet in hopes of rescuing the survey team that had been lost there six weeks earlier. The aliens, Lactrans, are telepathic, and by concentrating their thoughts on one subject, our heroes are able to convince the Lactrans to return a communicator to Kirk, who promptly contacts the Enterprise for an emergency beam-up. Scotty accidentally locks on to a Lactran child that had grabbed the communicator, but happily the child scours the Enterprise's memory banks and learns more about the Federation, and is able to convince the other Lactrans that the Humans, Vulcans, and other member of the Federation should not be kept in a zoo.
(Here ends the adapted episode. The remaining story is newly-written for this book.)
In exchange for setting them free, the Lactrans ask that the Enterprise helps them to acquire a jawanda, a specimen for their zoo which they have been unable to retrieve. Kirk readily agrees. There is one wrinkle: the Lactrans do not know how to capture it, and have, over many, many years, forgotten the precise location of the Boqus, a species they believe does know how to capture a jawanda.
So, at the direction of the Lactrans, the Enterprise heads out into the blackness beyond the edge of the galaxy, seeking the planet Boqu. At length, they manage to find it, but there is a problem: the Boqus have been devastated by some mysterious plague, and they are–sensibly–more concerned with the survival of their species than the success of an intergalactic safari. The survivors agree to help them only if Dr. McCoy can cure the plague.
McCoy's task is even harder than it sounds, though: the Boqus are a silicon-based species, which, we are told, has never before been seen in the galaxy. This is a mistake on Foster's part, though–the Horta, at least, was silicon-based, and McCoy himself treated its injuries. In any case, McCoy struggles with the plague, finally enlisting the aid of the head of the Enterprise's geology section. Between them, they are able to determine the cause of and devise a cure for the plague: long-lasting storms on the planet are blocking out certain radiation which is necessary for the Boqus continued health, so McCoy prescribes a course of radiation therapy.
With the plague cured, the Boqus are prepare to assist in capturing a jawanda, using a device which they had, long ago, used to drive the jawanda away from Boqu. This fantastic device requires them to bring along six of Boqu's moons, so the Enterprise must proceed at no more than warp 3, so the ancient engines in the moons will be able to keep up.
At length, their slow search turns up a jawanda: a creature only a millimeter thick but with a surface area about as large as North America. The jawanda eats radiated energy and–of course–finds the highly concentrated energy produced by the Enterprise to be a delicacy. It wraps itself around the ship and absorbs the energy produced by the warp drive, leaving the Enterprise motionless and helpless. Didn't we see a very similar threat in "The Time Trap"?
Eventually, Kirk resolves to attempt to overfeed the jawanda and orders maximum output from the engines. At he last moment, this succeeds, and the Enterprise is able to escape and, ultimately, entrap the jawanda. Their troubles do not end there, however: the jawanda begins to cry for help, attracting the attention of several other, much larger jawanda. The specimen captured by the Enterprise, it seems, was only a baby, and others of its species hurry to its aid. The Enterprise manages–barely–to outrun the rescuers, including one as big across as fifty Earths, and deposit the baby safely in orbit of Lactra.
With their service to the Lactrans completed, the Enterprise is free to go, and the book closes with Kirk musing on what other gigantic creatures might await beyond the edge of the galaxy.