In Portland, Oregon, in the near future, George Orr is charged with abuse of multiple prescription medications, which he takes to keep himself from dreaming. Orr volunteers for psychiatric care to avoid prosecution, and is placed under the care of licensed oneirologist Dr. William Haber. Orr's explanation for his drug dependence is astonishing: since age 17 he has known that his dreams can change reality, and he fears that this effective dreaming could upend his world.
Haber initially treats Orr's fear as a possible delusion—perhaps an intelligent schizophrenia—referring to him as "possibly an intelligent schizophrenic." The doctor induces a hypnotic trance while connected to the "Augmentor," a device he has devised to monitor and enhance brainwaves during dreaming, in order to aid therapy. He urges Orr to dream with purpose, recording brain activity as the dream unfolds. Even as the dream plays out, the world shifts in small ways, and Haber begins to believe that Orr's account may be true.
Haber starts leveraging Orr's effective dreams, first to build a prestigious, well-funded institute run by himself, then to tackle a range of social problems. But the results soon unravel: Haber imagines that Orr should dream up a solution to overpopulation, which would unleash a plague killing three-fourths of humanity; he envisions an end to all conflict on Earth, which would bring about an alien invasion that unites mankind; and he contemplates eradicating racism, creating a world where everyone's skin is a uniform shade of gray.
Orr seeks help from Heather LeLache, a lawyer, to escape the government-mandated treatments at Haber's hands. LeLache doubts Orr's sanity but agrees to assist, gradually becoming an ally. In time, Orr and LeLache grow closer, and Orr falls in love.
Only after repeated failures to "make the world right" does Haber admit that he believes in Orr's power. Having used the Augmentor to record and analyze Orr's extraordinarily complex dreaming brainwaves, Haber begins building a machine that would let him have his own effective dreams and directly remake reality.
As Haber presses on, Orr recalls a dream from years earlier that is briefly shown at the film's opening and, as it turns out, is reality: a nuclear war devastates the world, and Orr is poisoned by radiation. In his dying moment, Orr dreams of a world where the war never happened, which leads to the events we witness.
Haber strides into the final iteration of his dream-directing machine and, upon discovering this truth, descends into madness. Orr, having joined him in the dream state, manages to halt Haber's nightmare before it can wipe out the world. The resulting reality blends aspects of the multiple worlds Haber conjured through Orr's dreams but remains comparatively stable. Orr grieves because the LeLache of this shared reality was not his close confidant or lover.
In the closing moments, Orr works in an antique store run by an alien. LeLache visits, with only a hazy memory of him, and agrees to share lunch. They encounter Haber, now in a wheelchair, on their way to their meal. Haber recognizes Orr yet cannot break free from his catatonia.