“The most important thing is the setting,” says Ruth Robbins, professor of Victorian literature at Leeds Beckett University in England. “In the 19th century, ghost stories were read aloud so that the atmosphere set people up to be pleasurably scared in a communal way.” Britons in the Victorian era were obsessed with ghost stories because they reflected uncertain times — the Industrial Revolution, a move to urban living and technological advances like the telegraph, a supernatural-seeming invention. “Start with elements that you may be afraid of because of that atavistic, primitive danger,” Robbins says. “Bodies that are apparently human but might not be, like dolls and portraits. If the narrative begins in a room with those items, you’re more likely to be haunted by that space.” Material detail is powerful, because ghost stories are often about objects. “People become possessed by possessions,” Robbins says.

Establish what kind of ghost is haunting the setting — ideally a figure from the past with unsettled business. Many ghosts “come back because the dead person can’t rest,” Robbins says. “Either they’ve been done violently to death or their possessions have been stolen. So they come back to put things back where they belong.” But you don’t want your ghost to be defined too clearly. “The way to get really frightening is if you go for something that you can only glimpse out of the corner of your eye and your other senses tell you that something is there. You can hear it, you can smell it, you can sense that it is really big.”

To get a feel for effective ways to be scary, read a wide range of stories, from Victorian literature to the modern day. “You might construct ghost stories in which the dead communicate through their Facebook pages or tweets or Snapchats,” Robbins says. “Ghost stories have always made use of modern technology.”

Determine what sort of resolution works best for you. A lot of ghost stories wrap things up like a “Scooby Doo” episode. Others leave your audience in a world that doesn’t feel secure. “Some of the best stories end out of nowhere, and we can’t explain it, and it leaves us feeling unsettled for ages,” Robbins says.