The horror mystery is one of the oldest forms of genre story telling there is. In fact, what is generally considered the first detective fiction, Edgar Allan Poe's Murders in the Rue Morgue, is not only a mystery but a monster story as well. From the very beginning, the two were strongly connected, and as mysteries came into their own, with a murder almost always at their center, the macabre came to play a bigger role in their development.
But if there is one particular subset of horror that is almost exclusively mystery, it is the ghost story. At the heart of practically every ghost story is the mystery of who the ghost is and/or why they exist. The Uninvited from 1944 gives us perhaps the best possible combination of the two. Truly a great mystery and ghost story, the film seamlessly weaves together the twists and turns that surprise the viewer endlessly.
Another great mystery from the same period, and a great ghost story to boot, is Portrait of Jennie, with Joseph Cotten and Jennifer Jones. Again, like the best ghost mysteries, the story is about both the "how" and the "why", in this case, Jennie's existence and her visitations to Eben, a mystery that comes to a thundering finale unlike few other cinematic spectacles of the forties.
The fifties, sixties and seventies continued to give us great mysteries that also played as ghost stories, from The House on Haunted Hill and The Innocents to The Haunting and The Legend of Hell House (lots of "h"s in that last sentence). Even such an over-the-top kill-fest as The Omen had a slight mystery at its center as Roger Thorn (Gregory Peck) slowly unravels what really happened that night in the hospital when his wife gave birth.
By the eighties, the formula hadn't changed much. Films like Ghost Story, based on the Peter Staub novel, dealt with the appearance of a menacing and murderous spirit whose true purpose isn't dredged up until the final act. And the special effects spectacle Poltergeist had a mystery, if only a slight one, propelling it as well. We know that the little girl gets taken, and eventually returned, by the spirits in the house but the "why" is buried deep in the story and only unearthed at the end.**
Even a modern day horror film like The Ring, based on the Japanese horror film, Ringu, in turn based on a 1991 novel, is a good mystery as well. In fact, the mystery aspects are what drive the whole story and, in my opinion, the main reason to watch it, much more than the rather tepid and cliched horror aspects. Hell, I kind of wish there hadn't been the whole murder tape curse going on but, rather, just the little girl's mystery. Of course, no one bothers to call it a mystery. On Wikipedia, it's referred to as a "psychological horror film" despite the obvious prevalence of the mystery at its center.
A good whodunnit revolves around murder in the first place, so extending the story out, just a bit, to include the supernatural really isn't much of a stretch. As a result, good mysteries and good ghost stories have always walked cold dead hand in cold dead hand. I like both genres on their own so much it's no surprise that the mystery ghost story is probably my favorite subset of horror overall. It's a relationship that feels as natural as a noose around the neck of Annabelle Loren with an appeal that's hardly mysterious.
*pictured at the top of the post: The Greene Murder Case, an early Philo Vance mystery in which members of the Greene family are knocked off, one by one, by an unknown force in an old, dark mansion.
**all above puns intended.