For the past two weeks, I’ve been haunted by a lesbian ghost story, and I hope its ectoplasm hangs around for a long time.

Plain Bad Heroines” is a shapeshifting novel by Emily M. Danforth. A hot amalgamation of gothic horror and Hollywood satire, it’s draped with death but bursting with life.

The book opens by calling forth the restless spirit of Mary MacLane. Though now largely forgotten, MacLane electrified America in 1902 when, at the age of 19, she published a shocking memoir originally titled “I Await the Devil’s Coming.” (Until further notice, all double entendres intended.) In this luxuriant confession — what she called her “record of three months of Nothingness” — MacLane announced herself as a kind of female Walt Whitman, bouncing between egotism and eroticism. “I know I am a genius more than any genius that has lived,” she proclaimed, giving voice to frustrated teenagers everywhere. “My strong and sensitive nerves are reeking and swimming in sensuality like drunken little Bacchantes, gay and garlanded in mad revelling.” Looking across the world’s literature, MacLane saw few figures like herself. “I wish,” she wrote, “some one would write a book about a plain, bad heroine so that I might feel in real sympathy with her.”

More than a century later, “I Await the Devil’s Coming” is still a gobsmacking book. At the time, it was an instant bestseller and, of course, instantly condemned by the usual powers that be. One can only imagine how young women must have thrilled to read MacLane’s outrageous descriptions of sexual longing.

And that’s exactly where “Plain Bad Heroines” begins. “It’s a terrible story,” Danforth writes with mock solemnity. In 1902, at the Brookhants School for Girls in Rhode Island, the students are obsessed with Mary MacLane and her forbidden memoir. Some of the bolder students have even started a secret club: the Plain Bad Heroine Society.

As the curtain rises, two leading members of that scandalous group run out into the dark woods — “the source of sinister nighttime things.” Alas, one of them steps on a nest of yellowjackets and is “swallowed up by the swarm at once, as if she now wore a writhing mummy wrap of yellow jackets, a pulsing black-and-yellow outline that smothered her until she was now them.” Her young lover, hoping to help, rushes toward her but is “at once wrapped in her own cloak of yellow jackets.” Long after the girls are dead, the furious wasps maintain such an impenetrable guard over the site that local authorities have to burn a patch of woods to recover their venom-steeped bodies.

That tragedy hangs over the doomed grounds of the Brookhants School for Girls, and the sound of those yellowjackets buzzes through the rest of the story. Indeed, “Plain Bad Heroines” may be the only novel I know that should come with an EpiPen.

What makes all this so much fun is Danforth’s deliciously ghoulish voice, a kind of Victorian “Gossip Girl.” (And Sara Lautman’s period illustrations are a wistful reminder that books didn’t always look so dull.) Winking to her Dear Reader, Danforth laces the text with ironical footnotes, ribald asides and witty clues of past and future disaster. The supernatural elements grow across these pages as slowly — and ominously — as black mold.

Our early-20th-century heroine is the principal of the Brookhants School for Girls, Libbie Brookhants. A closeted lesbian, she comes to own and run the esteemed academy through a bargain with a wealthy spiritualist that will eventually cost her dearly. For now, though, Libbie must try to stop a string of deaths tied to the libidinous influence of MacLane’s wicked memoir. But her efforts are considerably complicated by the fact that she’s as obsessed with MacLane’s memoir as any of her students.

And I haven’t told you the half of it!

Interlaced through this feverish antique tale is a modern-day story about the making of a horror movie based on the legend of the long-closed Brookhants School. Chapter by chapter, we shift back and forth, from the ever-swelling calamities at the academy to the absurd machinations of Hollywood. Danforth, who teaches English at Rhode Island College, has a perfect ear for both eras: the strict gentility of 1902 and the rapid-fire patter of today’s content creators.

The movie’s lead is a “celesbian-megastar” named Harper Harper, whose international allure stems from her unblemished authenticity on social media, which is the sort of irony that Danforth exploits to maximum effect. We get to see Harper’s backstory as a Montana hick and the convoluted way two other young women are lured in by an auteur director who fancies himself Alfred Hitchcock reincarnated.

Danforth knows just how to situate this movie — “The Happenings at Brook­hants” — in the great canon of horror schlock that extends from the bikini-clad scream queens to “The Blair Witch Project.” As the production starts up and the special effects blend with spooky phenomena, readers will be reminded of Marisha Pessl’s “Night Film” with its double helix of real and imaginary terrors.

Like the hum of those yellowjackets resonating across the decades, strange parallels begin arising between 1902 and now. Will the malevolent energy that struck the Brookhants School poison the cast reenacting those old tragedies? “That’s history for you,” one of the producers says. “When you dig it up, it always carries a whiff of rot.”

Though “Plain Bad Heroines” is endlessly amusing, cranks may claim it’s a bit too endless. Even the backstories have backstories, and those backstories have footnotes. Sure, tighter editing might have clipped 150 pages from Danforth’s gregarious manuscript, which feels like it never comes upon a dark alley it can resist exploring, but there’s something exhilarating about this omnivorous narrator who wants everything. Mary MacLane would understand that lustful hunger. It stings — but oh, the sensation is exquisite.

Ron Charles writes about books for The Washington Post and hosts

Read more:

Plain Bad Heroines

By Emily M. Danforth

William Morrow. 623 pp. $27.99