The rare horror movie that’s not merely a good horror movie but a good movie, period, Ari Aster’s “Hereditary” is definitely slow-burning but builds up a powerful head of squirm-inducing tension over the course of two hours. If the ending goes into rather outlandish territory to tie things up, you can’t say that it hasn’t been telegraphed well in advance; you have no more reason to complain than you did with, say, “Rosemary’s Baby.”

The film is filled with remarkable performances, but the one that anchors it is that of Toni Collette, who plays Annie Graham. Annie is an artist specializing in miniaturized, meticulously sculpted scenes of daily life, and as she is working on an upcoming exhibit, her mother dies. She and Annie had been estranged for years—as Graham explains in a shattering outburst at a grief-group meeting, one of several riveting monologues Aster provides Collette with in the course of the film—as a result of the blame Annie placed on her for the treatment of her father and older brother, which she believes led to their deaths. Nonetheless when her mother fell ill with dementia, Annie and her placid, supportive husband Steve (Gabriel Bryne) took her into their home, a secluded wooden mansion, complete with stain-glass windows, somewhere in the Northwest.

During her time with the family, Annie’s mother apparently grew close to the couple’s younger child, a girl named Charlie (Milly Shapiro), an odd duck who seems to live in a world of her own and periodically makes odd clicking sounds with her tongue (there’s even a suggestion of telekinetic abilities). Annie says the old woman stuck her claws into Charlie—although she had never shown much interest in Charlie’s older brother Peter (Alex Wolff), a solemn high school student who tries to fit in but doesn’t have the knack and smokes a lot of pot to compensate.

Annie is surprised at the number of people who show up at her mother’s funeral, because before her illness she had been a secretive, reclusive person with a disconcerting interest in spiritualism of a sort, and Charlie spies some of them doing very peculiar things when viewing the body. But that pales when Annie thinks she sees her mother’s spirit in the darkness of the room where her boxed-up belongings are kept. Of course, that might have been just a hallucination. What’s undoubtedly real is a phone call from the cemetery informing Steve that her grave has been desecrated.

Annie’s stress at coping with her mother’s death and her exhibition deadline take a toll, and she decides to attend that group grief session where her feelings spill over. But her emotional state takes a horrible turn when Peter asks permission to go to a high school party where he hopes to connect with a girl he likes. Annie insists that he take Charlie along with him—to give her the opportunity to work in quiet, apparently, though she insists it’s in the hope that Charlie can make some friends there. He does, and the evening turns out horribly wrong. It is in the aftermath of that tragedy that Annie returns to the grief meeting and meets an incredibly sympathetic woman named Joan (Ann Dowd), who introduces her to a mechanism that might assuage her pain.

To go beyond this point would constitute a massive string of spoilers. Suffice it to say that the Graham family dynamic deteriorates to gruesome levels and secrets emerge about granny’s interests, her friends and her plans for the future. The revelations ultimately take a turn that some viewers won’t be able to swallow, considering the explanation a ludicrous twist that transforms what has until then been a supremely unsettling supernatural thriller, a frightening tale of how mental instability can run through generation after generation, into something more blatantly genre-oriented.

But whatever your reaction to the denouement, the caliber of Collette’s performance is amazing. She is positively ferocious, especially at those times when she spits out those bitter monologues Aster has composed for her. But the power of the film does not rest on her alone. She is actually matched by Wolff, who, in his portrait of a cruelly damaged young man, is both her opposite and her complement. The young actor has done fine work in the past, but nothing that has prepared us for this scrupulously observed depiction of a profoundly sad boy. Byrne’s quizzically observant demeanor stands in stark contrast to both, and Shapiro quietly conveys Charlie’s peculiar vibe with a degree of reticence that is truly alarming. At the other end of the spectrum, Dowd positively explodes in a show of friendship that could be either genuine or nefarious.

“Hereditary” depends less than most of today’s horror films on visual effects, but those that occur under Eran Dinur’s supervision are harrowing, and the editing of Jennifer Lame and Lucian Johnston use them for all they’re worth, particularly in distinction to the morose, lapidary atmosphere they and Aster bring to the rest of the film. Grace Yun’s production design is exquisite, most notably in the interior sequences of the Graham home, and cinematographer Pawel Pogorzelski takes full advantage of the atmosphere she has created. Special praise must be paid to Steve Newburn for his shrewd design of Annie’s miniatures, which Aster and Pogorzelski employ for some truly creepy transitions.

Most modern horror movies are gory, grisly junk, but occasionally one transcends the dross and becomes a work of artistry in its own right. “The Babadook” was one. “Hereditary” is another.