--Peter Nichols in The Encyclopedia of Science Fiction (1995)
In an encyclopedia article on Gothic science fiction (from which the quote above comes), Peter Nichols offers his view of the origins of the Gothic in literature:
The Gothic may be seen as a reaction to the emphasis on reason which prevailed in the Enlightenment . . . . In a world ruled by Order . . . some room needed to be left for mystery, the marvellous [sic], the evil, the inexplicable.
Usage of the term "Gothic" in literature derives from The Castle of Otranto by Horace Walpole, tellingly subtitled "A Gothic Story" and published in 1764. (1) With its "frightened heroines, unseen horrors, and ghostly visitations in gloom-ridden medieval architecture," The Castle of Otranto inspired a trend that carried on into the nineteenth century. (2) Even a novel such as Jane Eyre, from almost a century later, has its Gothic elements.
After the publication of The Castle of Otranto, novel after Gothic novel (or perhaps more accurately in literary terms, romance after Gothic romance) came off the printing press: Vathek (1784) by William Beckford, The Mysteries of Udolpho (1794) by Mrs. Ann Radcliffe, The Monk (1796) by M.G. Lewis, Zofloya (1806) by Charlotte Dacre, Melmoth the Wanderer (1820) by Rev. Charles Maturin. In Frankenstein (1817), Mary Wollstonecraft Shelley married science and Gothicism, thereby writing what some consider the first science fiction novel but in the form of a Gothic romance. (3) In writing that novel, Mary Shelley seems to have attacked a problem, namely, how does the artist reconcile Gothicism--"a reaction to the emphasis on reason"--with modern science, a product of reason? Fritz Leiber--a writer of both fantasy and science fiction--ran into the same kind of problem at the outset of his career. Leiber had more to deal with though, for the twentieth century was one fully under the sway of science, reason, and materialism; a century of increasing urbanization, industrialization, and mechanization; a century of isolation, alienation, and existential anxiety, if not existential horrors.
* * * * *
Although he also wrote humor, satire, and criticism, Edgar Allan Poe (1809-1849) lands pretty squarely in the Gothic tradition, and a straight line can be drawn between him and Weird Tales. However, Poe never wrote in the form of pure fantasy (at least that I'm aware of), a genre that helped keep Weird Tales in print for at least the first half of its existence (that is, until 1938 or so). The literature of fantasy, exemplified in the twentieth century in the work of J.R.R. Tolkein, Lord Dunsany, H.P. Lovecraft, Robert E. Howard, Clark Ashton Smith, and others, finds its origins only in the nineteenth. Fantasy stories may go back to ancient (or prehistoric) myths and legends, but what we read today started with writers such as John Ruskin (1819-1900), George MacDonald (1824-1905), and William Morris (1834-1896). Significantly, Morris was a Pre-Raphaelite, while Ruskin influenced the young men who made up that group. As with eighteenth century Gothicism, the Pre-Raphaelites were in reaction to recent cultural developments. They too were "fascinated by medieval culture" (4) and wanted to return to what they believed to be the spirit and method of the late Middle Ages and the early Renaissance, hence "Pre-Raphaelite." (5)
The upshot of all this is that weird fiction, woven from threads of nineteenth-century fantasy, eighteenth-century Gothic romance, and earlier stories of ghosts, vampires, witches, and werewolves, is essentially Medieval (and European), whether in descent through folk culture or in modern reaction to the higher culture of literature, art, science, and philosophy. The question for the writer of weird fiction is this: How do I write a tale from Medieval times when the world is no longer Medieval in nature? Better yet: How can the weird tale be relevant in a material age?
Notes
(1) According to Peter Haining in The Art of Horror Stories (1986), The Castle of Otranto was published on Christmas Eve 1764. In other words, Fritz Leiber, Jr. and the Gothic novel came into the world on the same day, separated by 146 years.
(2) Quoted from Alternate Worlds: The Illustrated History of Science Fiction (1975) by James Gunn. Mr. Gunn took note of the then-recent revival of Gothic fiction. He was probably referring to romance novels, but there were Gothic revivals in other media as well, such as in Dan Curtis' television series Dark Shadows (1966-1971). It's interesting to note that the 1960s and '70s revival of Gothicism coincides pretty well with a renewed interest in pulp fiction and fantasy, especially the work of Robert E. Howard, H.P. Lovecraft, and J.R.R. Tolkein.
(3) Significantly, that novel came out of a contest (among the Shelleys, Lord Byron, and Dr. Polidari) to write a ghost story. As Fritz Leiber's fictional character from over a century later said, "Each culture creates its own ghosts" (from "The Hound" in Weird Tales, Nov. 1942).
(4) Quoted from the Wikipedia article, "Pre-Raphaelite Brotherhood."
(5) Edgar Allan Poe died in 1849, a year after the founding of the Pre-Raphelite Brotherhood and about halfway between the publication of The Castle of Otranto (1764) and the first issue of Weird Tales (1923).