It Comes at Night. Photo: A24

In Trey Edward Shults’s first feature, the remarkable 2016 home-for-Thanksgiving psychodrama Krisha, members of his own family played roles in the story of a barely recovered alcoholic woman who returns to the fold — only to succumb again and bring on chaos and despair. Shults’s vision of family is thus double-edged: Yes, they fuck you up. But if you happen to need money and actors and a house in which to shoot, where else do you turn? Families are terrifying. Families are essential.

The focus of his second feature, a grueling quasi-horror film called It Comes at Night, is also a family in extremis. But this one is more elemental. The movie opens with a tender scene between an aged, sick father and daughter, who weeps as she tells him that she loves him. Then her husband and son bring the old man outside in a wheelbarrow, tip him into a pit, shoot him in the head, and immolate his body. He was, you see, infected by a plague that brings boils and upchucked black goo. Sarah (Carmen Ejogo) had no choice but to let her husband, Paul (Joel Edgerton), and son, Travis (Kelvin Harrison Jr.), execute him. It was to protect the family.

It Comes at Night asks, “How far should you go to protect the family?” The question hangs from first frame to last, as Paul and Sarah and Travis (and a dog) live in their boarded-up house in the woods, guns at the ready to blast anyone who comes near. Shults has set the film in a vacuum. There are no scientific explanations or radio broadcasts or internet messages. The family has no clue where this virus came from or how much of civilization is left. The narrative proper begins with the arrival of someone outside the family, a young man who breaks through the one working door from the garage and whom Paul promptly coldcocks.

His name is Will (Christopher Abbott) and he has (he claims) a family of his own. He didn’t know (he claims) that there was anyone alive in the house he broke into. He just wants (he claims) more food for his wife and small son. Paul leaves Will tied to a tree overnight to make sure that a squad of pillagers isn’t right behind him. Then he and Sarah have something major to decide: Do they want to make their family a little bigger? Can they even make nice-nice under these apocalyptic circumstances?

It Comes at Night is one of those movies with more scares from the characters’ bad dreams than from anything that manifests itself indoors. Maybe that’s the meaning of the title, since nothing about the virus is especially nocturnal. Or maybe the “it” in that title means, simply, fear. It comes with Will. It comes later in the form of a lost dog. And yes, it comes with those nightmares — especially Travis’s, which are doozies. The atmosphere is so thick with dread that nothing much needs to happen to make you sweat. And when Will’s young wife, Kim (Riley Keough), and son, Andrew (Griffin Robert Faulkner), arrive, something else haunts Travis’s dreams. The teen’s hormones are raging, and Kim’s impact on him is seismic.

When I watched Krisha, I knew why Shults had to make it, and the tension between his stark realism about people’s capacity to change and his humanistic faith that they will always keep trying (and failing … and trying …) made it flower as great drama. I’m not quite as sure why he made It Comes at Night. But it’s a fascinating laboratory for a young director making his second feature. Shults has contrived a situation in which generous people must constantly make cruel decisions, in which every bit of softening brings risk. Working this time with superbly trained actors, he elicits tremulous and raw performances — acting without safety nets. Behind a mountain-man beard, Edgerton gives another masterly minimalist performance, and Ejogo and Harrison are preternaturally alert. The cast functions brilliantly as individuals and as a unit, each in his or her own world but linked near-telepathically to the movements of the others. Like, come to think of it, a family.