The novel deals with Ralph Roberts, a retired widower who begins to suffer from
insomnia.As the condition worsens, he begins to see things that are invisible and intangible to others: colorful manifestations of life-force surrounding people (auras), and diminutive white-coated beings he calls "little bald doctors", based on their appearance. Roberts perceives other planes of reality and their influence upon the "real" world. He finds that his longtime friend, Lois Chasse, is also a sufferer. They eventually discover that their insomnia has in fact been induced by the two little bald doctors to enable them to defeat the agents of the Crimson King.
Lois and Ralph name the doctors Clotho and Lachesis (the good guys) and Atropos (the rogue doctor), after the Moirae of mythology. Ralph overcomes Atropos and forces him to promise to stay out of their business, the doctors all being bound by their word, but Atropos has his revenge by showing Ralph a glimpse of the not too distant future in which he claims the life of the innocent Natalie Deepneau. Ralph is able to counterbalance this however, by striking a deal with Clotho and Lachesis whereby he trades his own life for Natalie's.
The story climaxes when Ed Deepneau, a deranged maniac and former neighbor of Roberts and Chasse, under control of an entity called the Crimson King attempts to crash a light plane containing explosives into the Derry Civic Center during a heavily-attended rally. At first Ralph and Lois think Ed's intention is to kill thousands of people in the immediate area; they discover however, that Ed has been possessed by the Random and brainwashed into becoming a kamikaze to help fulfill the Crimson King's true motive. The Crimson King wishes to kill a boy named Patrick Danville. Danville is the focus of a prophecy concerning the salvation of The Dark Tower (and indeed returns with a key role in the seventh book in The Dark Tower series). Danville cannot, for undisclosed reasons, be killed directly by anyone born under either the Random or the Purpose.
However, from time to time a being is born who is "undesignated". An undesignated person is described as being like a blank card, and is up for grabs by either side. Deepneau is one such person, in fact the only person on earth at that time of undesignated status. Ralph defeats the King and forces the light plane to crash into the parking lot; killing Deepneau and sparing Danville's life, allowing him to fulfill his destiny and setting the path for the Dark Tower series.
The story ends on a tragic note as Ralph, to uphold his bargain with Clotho and Lachesis, is hit and killed by a car to prevent Natalie Deepneau from being killed in his place. The story closes on the remark that Ralph is finally able to rest.