There have been movies about haunted boats before, but the genre’s poor reputation is certainly not improved by “Mary,” a well-produced but soggy would-be thriller that sinks to the depths despite a game cast.

The script by Anthony Jaswinski announces the premise in an opening caption that speaks of an old practice of drowning witches at sea and the possibility that they might return to take vengeance on children. That’s somehow connected with the titular vessel, a nineteenth-century sailing ship with a bow featuring a carving of a stern woman—presumably one of the witches so done away with. The idea is that her spirit inhabits the boat and—as is gradually revealed—has been having her way with families unwise enough to sail her: they have all disappeared mysteriously at sea, leaving the vessel deserted.

Jaswinski was obviously inspired by the story of the Mary (often misspelled as Marie) Celeste, the brigantine that was found adrift in the Atlantic in 1872, her crew simply gone. Theories about what had happened to them abounded; the young Arthur Conan Doyle wrote a story that floated one. The fate of the crew remains unknown. The script simply conflates that story with the legend related by the introductory caption.

The picture opens with one of those after-the-fact prologues—fairly disruptive of suspense—in which Sarah Greer (Emily Mortimer) is being questioned by Detective Clarkson (Jennifer Esposito) about what happened on her family’s boat, the Mary. She was found clinging to the burned remains of the vessel, and her two daughters Lindsey (Stefanie Scott) and Mary (Chloë Perrin) found safe in a lifeboat. But her husband David (Gary Oldman) is missing, along with first mate Mike (Manuel Garcia-Rulfo), and Sarah is suspected in their deaths.

Most of the rest of the picture is a long flashback showing what happened. David, working as a guide on another man’s excursion boat on the Florida coast, impulsively purchases the Mary, which had been found adrift and empty by the Coast Guard, at auction: he’s long wanted to captain his own vessel, and though the Mary needs a lot of work, it “calls” to him. Sarah is initially angry, but she mellows under his insistence that it will provide a new beginning for their marriage (which a later revelation about Sarah’s infidelity suggests is needed).

So after a montage showing the family sprucing up the boat and some celebrating with friends, the Greer family is off on a test voyage into the Bermuda Triangle, taking along Mike and Tommy (Owen Teague), a young man with a troubled past whom David has been mentoring—and who is close to Lindsey. Unfortunately, scary things start happening almost at once. Sarah had terrible nightmares and experiences hallucinations. Little Mary becomes surly, and starts drawing frightening pictures. And Tommy has a psychotic episode; he’s found staring at that carving of a woman on the bow, having injured himself with a knife, which he then turns on David. The men subdue him and drop him off at the next port for treatment.

As things get progressively worse, Sarah investigates the boat’s dark past, with several disappeared families in its history, while David becomes more intent on completing the voyage. Mike is the siren’s next victim, and Sarah and David must fight him to keep themselves and their girls alive. But the sea-witch, whoever she was, seems unstoppable, even if it means she must take direct action, without using a possessed intermediary.

Oldman and Mortimer don’t merely show up and collect their paychecks here; they give genuinely committed performances, far beyond what the material deserves. The other cast members don’t match them, but are certainly acceptable, while Michael Goi, who serves as cinematographer as well as director, shows himself capable in both roles, maintaining the sense of confinement necessary to such a tale while offering some elegant widescreen images.

But Jaswinski’s script is a thin piece of work, and even with editing by Eric L. Beason and Jeff Betancourt that brings the picture in at only eighty minutes or so (not counting the final credits), it drags badly. And though a coda that brings us back to the opening interrogation room is meant to offer a surprising twist, the revelation comes across as both predictable and silly, particularly because it features effects that, like those earlier on, are mediocre.

This is a movie as creaky and rickety as the boat it’s named after.