Alex Gardner (Dennis Quaid) is a psychic who is hired by his former university professor Paul Novotny (Max Von Sydow) and his assistant Jane (Kate Capshaw) for a project involving sleep disorders. The project calls for psychics to use their ability to enter other people's dreams and manipulate the events. Alex is successful in his initial attempts, namely by helping a man worried about his wife's infidelity and vanquishing a bogeyman in the nightmares of an 8-year-old boy. Alex and Jane also start an uneasy relationship, because it began with Alex entering one of Jane's dreams and sexually arousing her.
Alex eventually learns that the entire project is being funded by a secret government agency headed by Bob Blair (Christopher Plummer), and he begins to think that Blair might have an ulterior motive when it comes to the project. One day, a test subject died while another psychic was in her dream. The psychic (David Patrick Kelly), who's name is Tommy, claims that the stress of the test must have killed her, but he actually killed her in her dream on orders from Blair to prove the theory that if someone dies in their dream, they die in real life. This allows Blair to proceed with his ultimate plan. The President of the United States (Eddie Albert) has been having nightmares about the aftermath of a nuclear attack, and he wants to begin talks with the Soviets about nuclear disarmament. Blair is against this, and he convinces the President to come to the university to have his dreams examined by a psychic. Tommy will then enter the President's dream and kill him.
Novotny figures out what Blair is up to, but he is killed by some of Blair's henchmen and Blair takes over the project. By the time Alex and Jane realize the truth, the President has already arrived at the university and Blair has begun the session. Alex and Jane sneak past the Secret Service and get close enough to the lab for Alex to enter the President's dream. Once inside, Alex is able to kill Tommy and save the President's life. He also is able to end the President's nightmares by telling him that everything in the nightmare hasn't happened, and it will never happen if he goes through with the disarmament talks. He also tells him that Blair is the one who sent the assassin. The President wakes up and quickly leaves the university, telling Blair that he is no longer welcome in the White House.
Alex and Jane have saved the President, but they know that their lives are now in danger from Blair. Before he can launch any plan of retribution against them, Alex enters Blair's dream one night and kills him. The movie ends with Alex and Jane leaving the university and beginning a new life together.