Charlie Reade is a seventeen-year-old boy living in the town of Sentry's Rest, Illinois with his widowed father, George. When Charlie was seven years old, his mother was struck and killed by a van, and the resulting grief led his father to alcoholism, from which he eventually recovered.
One day, Charlie discovers his elderly neighbor Mr. Howard Bowditch injured in his yard and calls an ambulance. Feeling indebted from his father's recovery, Charlie agrees to watch Mr. Bowditch's German Shepherd dog, named Radar, while Mr. Bowditch stays in the hospital and cares for him when he returns home. Mr. Bowditch shares with Charlie his .45 caliber handgun and a stash of gold pellets that he uses to pay the hospital bills. Several months later, Radar's health has significantly declined, and Mr. Bowditch suffers a heart attack and dies. He leaves Charlie a recorded message, revealing that he was actually 120 years old, and that the locked shed in his backyard contains a portal to another world. In this world exists a magical sundial that was the secret to his longevity. He also reveals the world as the source of his gold and urges Charlie to keep it secret to prevent its exploitation. Determined to save Radar's life, Charlie decides to seek out the sundial and revitalize her.
Charlie, armed with two handguns, travels with Radar to the other world, which he learns is called Empis. He meets a shoemaker named Dora, and exiled members of the royal family Gallien: Leah, Stephen "Woody" Woodleigh, and Claudia, who provide Charlie with guidance and food. Charlie learns of Flight Killer, the great evil who purged the royal family. The surviving members of the family were cursed with disability and disfigurement, and the inhabitants of Empis are afflicted with an illness known as "the gray." Charlie navigates to the deserted city of Lilimar and finds the sundial, rejuvenating Radar to her younger self. On their way out of the city, interference causes Charlie to become lost, and they are ambushed by an army of undead "night soldiers." Radar escapes, but Charlie is taken captive to an underground prison called the Deep Maleen.
While imprisoned, he and the other inmates are forced to train for a gladiatorial-style tournament known as the Fair One. Charlie learns from the inmates that Flight Killer is actually Elden of the Gallien, Leah's brother. He also discovers that his formerly brown hair and eyes are turning blond and blue, respectively, which the inmates believe is a sign that Charlie is their true prince and savior. Eventually, the Fair One tournament begins; Charlie survives the first round, but before the second round begins, he and the remaining inmates escape the facility with the help of a warder named Pursey.
Once outside the city, Charlie is reunited with Radar, Dora, and the Gallien family. They tell Charlie of Elden's past: as the two youngest siblings, Leah and Elden were very close. Elden, however, was badly bullied for his appearance and deformities. At some point, Elden discovered the Deep Well, which can only be opened when the two moons of Empis touch in the sky, and inside which lives an evil creature called Gogmagog. Elden opened the Deep Well, which led to him becoming Flight Killer, attaining power as Gogmagog's puppet, and cursing Empis out of revenge for his mistreatment. They plan to return to Lilimar and defeat Flight Killer before the moons collide again and he can open the Deep Well once more. Leah is conflicted due to her love for Elden, refusing to believe that her brother is actually Flight Killer. However, Charlie convinces her to join them.
Charlie, Leah, and Radar lead a small group to infiltrate the city and eventually find the Deep Well, with Flight Killer waiting at its entrance just as the two moons collide and the well opens. Leah, finally seeing Flight Killer with her own eyes, accepts what he has become and stabs him with her dagger before he is dragged into the well by Gogmagog and killed. As Gogmagog emerges, Charlie—reminded of the story of Rumpelstiltskin—repeatedly declares its name, causing it to retreat back into the well in defeat. They return to the surface where Charlie announces their victory and proclaims Leah as their new queen.
Charlie recovers from his injuries sustained from the encounter, and his hair and eyes revert to their original color; meanwhile, the citizens begin to rebuild the city. At last, Charlie and Radar say goodbye and return home through the portal. Charlie, who was reported missing in the four months that he was in Empis, reunites with his father in a deep embrace. In the epilogue, Charlie takes his father on one last trip to Empis to prove to him its existence before sealing off its entrance with concrete, preventing anyone else from finding it.