Richard Matheson's I Am Legend was filmed three times, most recently in 2007 starring Will Smith. Photograph: Ron Galella Ltd/WireImage
Richard Matheson, the prolific American writer of fantasy, horror and science fiction, much of whose work has been adapted for TV and cinema, has died aged 87. Cited by Stephen King as the biggest influence on his own work, Matheson sent shivers down the spines of readers and viewers for decades, with such unusual novels and stories as The Incredible Shrinking Man and the much-filmed I Am Legend.
He turned his hand to pacy adaptations of Edgar Allan Poe stories for the film director Roger Corman, to the story and screenplay for one ofSteven Spielberg's most effective films, Duel (1971), and 16 instalments of the popular and ingenious television series The Twilight Zone. For Matheson, horror was potentially everywhere: battlefields, suburban streets, a cellar, an aircraft cabin – even a library.
Matheson was born in Allendale, New Jersey, to Norwegian parents, and brought up in Brooklyn, New York. As a youngster he first set his heart on a musical career, but an avid appetite for fantasy sparked his imagination and fired his creativity: he was only eight when his stories appeared in a local newspaper, the Brooklyn Eagle. He was transfixed by seeing Dracula at a local cinema and by his teens had the idea for the vampire story I Am Legend. After he graduated from Brooklyn technical high school in 1943, second world war service intervened.
He later described his experiences through the eyes of a common soldier in his acclaimed novel The Beardless Warriors (1960). A key scene catches the surprise and ambiguity that had become his trademark: "A little while ago, each side had done its lethal best to decimate the other. Now, the guns and cannons temporarily stilled, each carried off the victims of their contest. To Hackermeyer it was brutal ambiguity; the condition of war at its most unfathomable. He looked at the Germans with hostile eyes. Why were they doing this? Why had they come with a white flag and, in a polite conference, arranged to forestall the war until the battlefield was tidied?"
Solitary, bewildered men recur in Matheson's work, and he developed such trademark characters while working nights as a linotype operator in California. He had moved to the west coast after graduating in journalism from the University of Missouri in 1949. He met his future wife, Ruth Ann Woodson, on a beach in Santa Monica; they married in 1952.
A first novel, Hunger and Thirst, went unpublished for several decades. A short story, Born of Man and Woman (1950), attracted notice and became part of his first story collection, published in 1954, the same year that I Am Legend appeared. In this tale, the last man on Earth is beset by vampires. Partially soothed by whisky, music and the companionship of a dog, he reflects in a library on all the books on its well-stocked shelves, "the residue of a planet's intellect, the scrapings of futile minds, the leftovers, the potpourri of artifacts that had no power to save men from perishing". It was filmed three times, as The Last Man on Earth (1964), as The Omega Man (1971) and, most recently, with Will Smith, as I Am Legend (2007).
In an even more intense book, The Shrinking Man (1956), Scott Carey is exposed to radiation and chemicals that cause him to grow smaller. He is pursued by a spider that appears bigger and bigger as he dwindles in size. Carey's terrifying situation was a variation on that era's preoccupation with man's identity amid the lonely crowd and threat of the bomb. Carey keeps faith – "a man's self-estimation was, in the end, a matter of relativity … he still had his mind, he was still unique" – despite his fear of a spider whose "pulsing egg of a body perched on running legs – an egg whose yolk swam with killing poisons". To Matheson's dismay, Hollywood added the adjective "incredible" for the title of the1957 film adaptation, The Incredible Shrinking Man, but the expanded phrase has entered the language and later editions of the novel were released under the new title.
In his account of horror writing, Danse Macabre (1981), King gives many pages to this short novel, which he thought redolent of its A-bomb era. He quotes Matheson as telling him the novel was partly inspired by watching a comedy film in which Ray Milland, leaving a flat in huff, accidentally puts on Aldo Ray's hat, which comes down past his ears: this set Matheson wondering what would happen if Milland's own hat had done so. Matheson said: "The entire novel was written in the cellar of the rented house on Long Island. I did a shrewd thing in that. I didn't alter the cellar at all. There was a rocking chair down there and, every morning, I would go down into the cellar with my pad and pencil and I would imagine what my hero was up to that day. I didn't have to keep the environment in my mind or keep notes. I had it all there, frozen."
Matheson also wrote thrillers in the 1950s, of which the best was Ride the Nightmare (1959). A Stir of Echoes (1958), again depicting suburban America, was his last fantasy novel for 12 years. Screen work regularly came his way from this period onwards. He contributed to Rod Serling's early 1960s television series The Twilight Zone, whose episodes twist towards ingenious endings. In the famous, much-parodied Nightmare at 20,000 Feet, a salesman, played by William Shatner, recovering from a nervous breakdown, sees in flight a creature "of a wide-pored coarseness" on the wing of the plane, which moves out of sight whenever other passengers glance its way. Matheson also provided five screenplays from Poe for Corman. Perhaps the best of these engaging low-budget works was a satirical take on The Raven (1963), with Boris Karloff, Peter Lorre, Vincent Price and newcomer Jack Nicholson.
When he heard news of the assassination of President John F Kennedyin Dallas on 22 November 1963, Matheson abandoned a game of golf and was returning home when he was continually tailgated by a truck. This inspired a long story, Duel, which he adapted for Spielberg's terrifying made-for-television movie. Spielberg added scenes for a cinema release, but Matheson preferred the TV version.
Other television films included The Night Stalker (1972) and a notable movie in which Dick Van Dyke drew on his own alcoholic struggle, The Morning After (1974). A Hammer work, The Devil Rides Out (1968), from the novel by Dennis Wheatley, gave much scope to a sinister Charles Gray as the leader of a satanic cult.
Matheson continued to write short stories, and also returned to novels with the gothic Hell House (1971), which became the lacklustre film The Legend of Hell House (1973). Bid Time Return (1975), in which a man travels through time to pursue the subject of a 19th-century portrait, was filmed as Somewhere in Time in 1980 with Christopher Reeve. What Dreams May Come (1978, adapted in 1998 into an Oscar-winning film with Robin Williams) revealed Matheson's growing preoccupation with psychic matters, and these were the subject of his non-fiction work The Path (1993). His work for children included the charming tale Abu and the Seven Marvels (2002).
Matheson is survived by his wife and their four children, three of whom became writers.
• Richard Burton Matheson, author and screenwriter, born 20 February 1926; died 23 June 2013