Jack Lucas (Jeff Bridges), a cynical, arrogant shock jock talk radio host, becomes suicidally despondent after his insensitive on-air comments inadvertently prompt a depressed caller to commit multiple murders at a popular Manhattan bar. Three years later, while heavily intoxicated and depressed, he attempts suicide. Before he can do so, he is mistaken for a homeless person and is attacked and nearly set on fire by ruffians. He is rescued by Parry (Robin Williams), a deluded homeless man who is on a mission to find the Holy Grail, and tries to convince Jack to help him. Jack is initially reluctant, but comes to feel responsible for Parry when he learns that the man's condition is a result of witnessing his wife's horrific murder at the hands of Jack's psychotic caller. Parry is also continually haunted by a hallucinatory Red Knight, who terrifies him whenever he shows any confidence.
Jack learns that Parry had slipped into a catatonic state following his wife's death and had remained there for a few years. When he emerged he seemed obsessed with the tale of the legend of the Fisher King, a form of which Parry recounts to Jack. The legend varies, but all iterations possess three elements: the Fisher King was charged by God with guarding the Holy Grail, but later incurred some form of incapacitating physical punishment for his sin of pride, and had to wait for someone to deliver him from his suffering. A simpleminded knight named Percival, referred to in the movie as "The Fool", healed the wounds with kindness to the king, asking him why he suffers and giving him a cup of water to drink. The king realizes the cup is the grail and is baffled that the boy found it, as demonstrated in the closing exchange: "I've sent my brightest and bravest men to search for this. How did you find it?" The Fool laughed and said "I don't know. I only knew that you were thirsty." Echoes of the legend recur throughout the film, but in a continually shifting manner, so that it sometimes appears that Lucas is Percival to Parry's Fisher King, sometimes vice versa, and sometimes that one or the other is re-enacting part of the story with another character (most obviously in Parry's self-assigned quest to obtain the Grail from the man he believes is its guardian).
Jack seeks to redeem himself and help Parry find the Grail and find love again. Jack sets Parry up with a woman Parry has been smitten with from afar, Lydia, a shy woman who works as an accountant for a Manhattan publishing house. Jack successfully introduces them to each other and sets up an equally successful dinner date (Jack and his strong-willed girlfriend, Anne, join them). Following dinner, Parry declares his love for Lydia but is once again haunted by the Red Knight. Parry tries to escape his hallucinatory tormentor but is attacked by the very thugs from whom he had earlier rescued Jack. The beating is not fatal but causes Parry to become catatonic again.
Jack promises to find the Grail for Parry. He infiltrates the Upper East Side castle of a famous architect and retrieves the "Grail", a simple trophy. When he brings it to Parry, the catatonia is broken and Parry regains consciousness. While he and Jack lead the patients of the mental ward in a rousing rendition of "How About You?", Parry is reunited with Lydia and Jack (who had earlier broken up with Anne for dubious reasons) reunites with his love as well.
The story opens in a radio broadcast studio where arrogant and cynical "shock jock" Jack Lucas talks to a caller about the banality of the social scene in New York City (where his show is broadcast). The caller tells Jack about a bad date he'd had recently, sounding quite despondent over being rejected by a woman. Jack tells him, in a largely dismissive tone, that social status dictates that the caller will never be successful if he tries to enter this woman's more aristocratic social circle. Jack's show ends for the day and he returns to his lush penthouse where quarrels briefly with his girlfriend (whom leaves) and admires himself, repeating his tagline ("FORGIVE me!!). Jack turns on the news and finds out that the despondent man he'd been talking to had killed several people in a popular Manhattan restaurant with a shotgun. Jack is devastated, blaming himself for the man's breakdown.
Three years later Jack is off the radio & morbidly depressed, living with a woman, Anne, who owns a video store downstairs from her apartment. Jack drinks heavily and works part-time for Anne. When Jack offends a chatty customer, Anne tells him to go back to her apartment and get some rest. That night, Jack, while watching a television show he's produced based on his radio experiences, insults Anne, saying that he's only lived with her for sex. Anne storms off and Jack leaves the apartment, taking a bottle with him. Mistaken for a bum on the street, a small child gives him a wooden Pinocchio doll. Jack ends up near the Manhattan Bridge at the East River, feeling suicidal with cinder blocks tied to his ankles. While he prepares himself to jump in the water, he's attacked by two young men who believe he's a vagrant; they beat him severely, douse him with gasoline and intend to burn him alive. Just as they light a match, they are attacked by another bum who speaks much like a medieval knight and wields a non-lethal bow and arrow. Several other bums join him and sing "How About You?" and Jack's would-be killers are quickly outnumbered and defeated. One of the killers is captured and tied up by the vagrants' leader and left to be victimized by anyone who comes along. Jack is initially terrified of the leader, who is suddenly kind and takes him to a safe area under a bridge, populated by more homeless men. Jack spends an hallucinatory night with them, even impressing them all when his coat briefly catches fire, causing him to dance around in a panic.
The man takes Jack back to his home, the maintenance room in the basement of an apartment building. The man tells Jack his name is Parry and that he's a knight on a sacred quest; Perry believes the Holy Grail is in the home of a prominent architect living in a castle-like building on the Upper East Side. Parry also hints that he is often visited by the "little people", hallucinations that advise him on the quest. Parry, however, is terrified of the Red Knight, a large, monstrous enemy that rides a black horse and breathes fire. Jack also notices that Parry has a small shrine dedicated to a young woman to whom he's infatuated, however, Parry yanks him away from the shrine when he discovers him there. Parry believes that Jack has been sent to aide him in his quest. Jack tells Parry openly that he's crazy and leaves. As he walks out he meets the building manager who at first thinks Parry has invited someone to live with him. The manager tells Jack that Parry used to live in an apartment in the building a few years ago before his wife was murdered. The manager goes on to say that Parry's wife was killed in the same tragic restaurant shooting incident that Jack believed he caused.
Jack goes back to Anne's apartment, finding her distraught at his disappearance but happy to see him alive. He explains what happened the previous night and how he was attacked. Jack realizes that much or all of his depressive state can be relieved if he helps Parry. He asks Anne about the Holy Grail and she pontificates on the nature of good and evil and God and the Devil. The two of them have sex. Later, Jack tells Anne that he feels he's cursed because of the trouble he believes he caused Parry and she tries to comfort him.
Jack revisits Parry's home and is met by the manager who tells Jack more about Parry: his real name is Henry Sagan and he was a professor of medieval studies at Hunter College. After his wife was killed, he fell into a catatonic state and lived in an asylum on Staten Island. One day he simply awoke from his catatonia and became Parry. He was taken back to his old apartment building where the manager allowed him to live in the basement. The manager also tells Jack that Henry was deeply in love with his wife.
Jack finds Parry in the Midtown area of Manhattan, sitting atop a parked car, oblivious to the alarm blaring. Jack offers Parry money for compensation, however, Parry gives it to another homeless man. Jack is angry, but Parry grabs him, pulling him behind a column. A woman, Lydia, has emerged from the skyscraper, the same woman that Parry had built the shrine to in his home. She is at once clumsy and awkward, finding it difficult to negotiate her way past people and through the building's revolving door. Parry and Jack follow her to a Chinese restaurant where they watch her through the window. Later, she stops at a news stand, where she buys a new novel, a habit that Parry has noticed; she buys a new book every few days. After she returns to work, Parry tells Jack that he's "deeply smitten" with her but lacks the self-confidence to approach her. Just then Parry's nemesis, the Red Knight, appears. Jack cannot see the monster; it is a hallucinatory manifestation of Parry's own fear that only he can see. However, Parry yells that the Red Knight is uncharacteristically afraid of Jack and drags Jack along on the chase. They race through Central Park until Jack, lagging behind, finds Parry sitting on a rock. Parry tells Jack that their combined effort has frightened the Red Knight off. The pair hear screaming and happen across another homeless man who had buried himself in the dirt of a horse trail in the park, hoping that riders will trample him. Jack and Parry take him to a homeless shelter where Jack comforts the man while Parry tries to stir the other patients into song. Jack talks briefly with the man they rescued who tells him he's a cabaret singer and a veteran who watched all his friends die.
Later, back in Central Park on the Great Lawn, Jack lays on the grass with Parry next to him. Parry is nude, unafraid of the danger in the park at night, and gazes at the clouds and stars and tells Jack the story of the Fisher King, who once possessed the Holy Grail but lost it, grew old and became depressed. The king was saved by a passing fool who gives him a drink of water; the cup he uses is the Grail itself and the king is revived. Parry says he has a vague memory of a lecture he gave on the story as a professor before his mental breakdown. Jack suggests that Parry needs to be introduced to Lydia and says he'll help him.
Jack returns to Anne's place and formulates a plan to have Parry meet Lydia socially. He poses as a contest official and tells Lydia she's won a free membership at Anne's store. Lydia is not so easily fooled and hangs up on Jack. Jack sends the cabaret singer to Lydia's office; the man does a flamboyant musical number informing Lydia she won the membership.
Lydia shows up at the video store. Parry is there too, posing as an employee. Lydia's membership is squared away and Parry helps her find a few movies to rent. She doesn't find any she'd like but notices that Anne has a fancy manicure. Anne tells her that she does her nails herself and she'll do Lydia's for a reasonable fee. Lydia agrees and Anne invites her to her apartment that night. Jack will meet them there later with Parry and they'll all go to dinner. Jack gives Parry his wallet to pay for dinner.
Anne and Lydia talk about Lydia's need for self-confidence. Jack helps Parry clean up for dinner. The four go to a Chinese restaurant where the plan to get Lydia and Parry together is successful. Jack and Anne go back to Anne's place and Parry escorts Lydia home. Lydia expresses many assumptions about Parry, believing that he'll stay with her one night and leave. Parry tells her that he's quite in love with her and promises to contact her again. As he leaves, Parry's abnormal fear hits him, he sees the Red Knight and runs screaming into the night. He ends up at the same spot where he found Jack when Jack attempted suicide. A few moments later, while Parry lies on the ground, twitching uncontrollably, the same two punks who tried to kill Jack find him - both are standing on either side of the Red Knight. The punks beat him severely.
The next day Jack calls his old radio agent and tells him he'd like to get back on the air. Anne comes on to Jack, however, Jack asks to talk to her seriously; Jack thinks that he needs to break up with her because his career may once again take off. Anne is instantly furious and upset and argues with him. Just then, Jack receives a phone call from the police; they found Jack's wallet on Parry when he was brought to a hospital. At the hospital, Anne and Jack find out about the assault and that Parry has become catatonic again. Parry will be remanded to a mental hospital until he regains his mind.
Jack settles quite easily back into his previous life as a radio host, however, his arrogance and insensitivity have mellowed greatly. He is also in talks to produce a television talk show. While in a meeting with a TV executive, Jack leaves unexpectedly and visits Parry, bringing him the Pinocchio doll he'd gotten from the child. Jack tells Parry that he knows Parry wants him to steal the "grail" from the castle on the Upper East Side, however, he also refuses to do it. Jack demands that Parry wake up, to no avail, and finally promises to undertake the dangerous mission.
Using Parry's plans and notes, Jack makes use of a slingshot to carry a rope and anchor to a parapet and the high tower of the castle. He makes it inside and creeps down the long staircase. About halfway down, he sees the man who shot Parry's wife and recoils at the hallucination. Jack finds the castle's study and the Grail, which turns out to be a trophy given to a "Lanny Carmichael". Jack hears a noise behind him and finds Carmichael slumped in an easy chair by the fireplace, having taken an overdose of medication. Jack tries unsuccessfully to wake the man up, choosing instead to leave by the front door, tripping the security alarm.
Jack once again visits Parry and gives him the cup. Exhausted, Jack slumps on Parry's bed and falls asleep. Some time later, Parry's fingers, holding the cup, begin to caress it. Parry wakes up and tells Jack that he really misses his wife.
The next day, Lydia visits Parry and finds his bed empty. Parry and Jack are leading the other patients in a rousing rendition of "How About You?". Parry sees Lydia crying and hugs her, asking her why she looks so sad. Jack continues to lead the other patients in song.
Jack goes to Anne's store and reconciles with her, admitting he loves her. She slaps him but accepts him back into her life. The story ends with Jack and Parry nude in Central Park, watching the clouds and laughing.