The Frighteners

In 1990, architect Frank Bannister's (Michael J. Fox) wife, Debra, dies in a car accident. He abandons his profession, and his unfinished "dream house" sits incomplete. Following the accident, Frank gained the power to see ghosts and befriends three: 1970s street gangster Cyrus (Chi McBride), 1950s nerd Stuart (Jim Fyfe), and The Judge (John Astin), a gunslinger from the Old West. The ghosts haunt houses so Frank can then "exorcise" them for a fee. Most locals consider him a con man.
Soon after Frank cons local health nut Ray Lynskey (Peter Dobson) and his wife Lucy (Trini Alvarado), a physician, Ray dies of a heart attack. Frank discovers there is an entity, appearing as the Grim Reaper, killing people, first marking numbers on their foreheads that only Frank sees. Debra had a similar number when she was found.
Frank's ability to foretell the murders puts him under suspicion with the police and FBI agent Milton Dammers (Jeffrey Combs), who is convinced Frank is responsible. Frank is arrested for killing newspaper editor Magda Rees-Jones (Elizabeth Hawthorne), who had attacked him in the press.
Lucy investigates the murders and becomes a target of the Grim Reaper. She is attacked while visiting Frank in jail; but they escape with the help of Cyrus and Stuart, who are both dissolved in the process. Frank wants to commit suicide to stop the Grim Reaper. Lucy helps Frank have a near-death experience by putting him into hypothermia and using barbiturates to stop his heart. Dammers abducts Lucy, revealing that he had been a victim of Charles Manson and his "Family" in 1969.
In his ghostly form, Frank confronts the Grim Reaper and discovers that he is the ghost of Johnny Bartlett (Jake Busey), a psychiatric hospital orderly who killed twelve people 32 years earlier, before being captured, convicted, and executed. Newspaper reports reveal that his greatest desire was to become the most prolific serial killer ever, showing pride at killing more than contemporaries like Charles Starkweather. Patricia Bradley (Dee Wallace-Stone), then a teenager, was accused as his accomplice, although she escaped the death penalty due to her underage status. Lucy resuscitates Frank and they visit Patricia. Unknown to them, Patricia is still in love with Bartlett and on friendly, homicidal terms with Bartlett's ghost, and eventually kills her own mother, who had been trying to monitor her daughter's behavior. Lucy and Frank trap Bartlett's spirit in his urn, which Patricia has kept. The pair make for the chapel of the now-abandoned psychiatric hospital hoping to send Bartlett's ghost to Hell.
Patricia and Dammers chase them through the ruins. Dammers throws the ashes away, releasing Bartlett's ghost again before Patricia kills him. Bartlett's ghost and Patricia hunt down Frank and Lucy. Frank realizes that Bartlett's ghost, with Patricia's help, was responsible for his wife's death and the number on her brow, and that he is still trying to add to his body count (and infamy) even after his death.
Out of bullets, Patricia strangles Frank to death, but Frank in spirit form rips Patricia's spirit from her body, forcing Bartlett to follow them. Bartlett grabs Patricia's ghost, while Frank makes it to Heaven, where he is reunited with Cyrus and Stuart along with his wife Debra. Bartlett and Patricia's spirits claim they will now go back to claim more lives, but the portal to Heaven quickly changes to a demonic looking appearance, and they are both dragged to Hell by a giant worm-like creature. Frank learns it is not yet his time and is sent back to his body, as Debra's spirit tells him to "be happy."
Frank and Lucy fall in love. Lucy is now able to see ghosts as well. Frank later begins demolishing the unfinished dream house and building a life with Lucy while the morose-looking ghost of Dammers is riding around in the sheriff's car. Frank and Lucy then enjoy their picnic.

Question: What does Ray die of?
Answer: Heart attack; Heart attack