Sam Wheat, a banker, and his girlfriend Molly Jensen, a potter, renovate and move into an apartment in Manhattan with the help of Sam's friend and co-worker Carl Bruner. One afternoon, Sam confides in Carl his discovery of unusually high balances in obscure bank accounts. He decides to investigate the matter himself, declining Carl's offer of assistance. That night, Sam and Molly are attacked by a mugger who shoots and kills Sam in a scuffle before stealing his wallet. Sam sees Molly crying over his body and discovers he is now a ghost; invisible and unable to interact with the mortal world.
Molly remains distraught in the days after Sam's death, as Sam remains close to her. Carl comes over and suggests Molly take a walk with him and Sam cannot bring himself to follow. Moments later, the mugger enters the apartment in search of something. When Molly returns, Sam scares their cat into attacking the thug, who flees. Sam follows the mugger to his Brooklyn apartment and learns that the man, Willie Lopez, was sent by an unknown party.
After leaving Willie's residence, Sam happens upon the parlor of psychic Oda Mae Brown, a charlatan pretending to commune with dead spirits who is shocked to discover her true psychic gift when she can hear Sam speaking. Sam persuades her to warn Molly that she is in danger. To allay Molly's skepticism, Oda Mae relays information that only Sam could know. Molly gives Willie's address to Carl; she then goes to the police, who have no file for Willie but they show her Oda Mae's lengthy one as a forger and con artist.
Meanwhile, Sam follows Carl and is devastated to learn he and Willie are working together. Carl is laundering money for drug dealers and he had Willie rob Sam to get his apartment key, which Carl uses to obtain Sam's book of passwords and transfer the money into a single account under the fictitious "Rita Miller".
Sam learns from a violent poltergeist haunting the subway system how to manipulate objects with his mind. Sam then persuades Oda Mae to help him thwart Carl. Before Carl can transfer the money for his clients, Oda Mae impersonates Rita Miller, closes the account, and gives the $4 million cashier's check to charity. As Carl desperately searches for the money, Sam reveals his presence by typing his name on the computer keyboard. Carl goes to Molly, who reveals she spotted Oda Mae closing an account at the bank. Carl and Willie go to Oda Mae's place but Sam warns her to take shelter. When Willie arrives, Sam tosses objects at him until Willie flees into the street in a panic and is killed by an oncoming car. Shadowy creatures emerge from the darkness to drag Willie's ghost down to Hell.
Sam and Oda Mae return to the apartment where—by levitating a penny into Molly's hand—he convinces Molly that Oda Mae is telling the truth about him. Oda Mae allows Sam to possess her body so he and Molly can share a slow dance. Carl breaks into the apartment but Sam is too exhausted from the possession to fight Carl. The women run onto the fire escape, to a loft under construction, but Carl catches Oda Mae and holds her at gunpoint, demanding the check. A recovered Sam pushes Carl off her so Carl takes Molly hostage, pleading with Sam for the check. Sam disarms Carl and attacks him again. Carl tries to escape through a window and tosses a suspended hook at Sam; the hook swings back to shatter the window and it slides down, fatally impaling Carl with a glass shard. The shadowy creatures return to claim Carl's ghost for Hell.
Sam asks if the women are all right. Miraculously, Molly can now hear him. A heavenly light shines in the room, illuminating Sam's presence. Realizing that it is time for him to go with his task now completed, he and Molly share a tearful goodbye and one final kiss. Sam thanks Oda Mae for her help, and she tells him that he is being called home. Sam then walks into the light and onward to Heaven.