From its brilliantly effective trailers, Lights Out -- the new horror film from first-time feature director David F. Sandberg -- comes across as your standard-issue fright fest: supernatural spook, family in peril, jump scares from wall to wall. And yet the film plumbs deeper waters than expected through the character of Sophie (Maria Bello) and her shadow-dwelling "friend" Diana, who mutually represent a surprisingly potent, and unusually perceptive, metaphor about mental illness and its capacity to wreak havoc on generations of families. For a genre not historically known for its sensitive portrayals of psychological disorders, that counts as something of a minor triumph, and the filmmakers deserve credit for bringing added heft to what could have easily been a surface-level scare machine.

The feature is a long way from Sandberg's original short film of the same name, which hit YouTube in 2014 and subsequently went viral before capturing the attention of producer Lawrence Grey, who helped Sandberg craft an outline for a feature-length version that brought the mental illness analogy into the mix. After getting horror maestro James Wan on board as a producer, the filmmakers hired Final Destination 5 and A Nightmare on Elm Street remake screenwriter Eric Heisserer, who along with Sandberg and Grey brought a personal connection to the material that deepened his interest in telling the story.

"We have anecdotally some personal experience with someone in our family or our friend circle who dealt with mental illness," Heisserer told me via phone. "For me, it was paranoid schizophrenia. For someone else it's clinical depression. We talked about those. We just spent a few meetings just talking about how everyone dealt with it, and how many people avoid it. How many people just put up a wall and decided not to admit that it was there?"

In Lights Out, Diana -- something of a cross between the Ring franchise's Samara and the scarred, vicious guilt-monster from Pascal Laugier's Martyrs -- literally lives in the dark, and while she exists as her own character with her own backstory, she ultimately comes to represent Sophie's inner darkness, which occasionally emerges to do psychological damage to her two children (Teresa Palmer and Gabriel Bateman). And there's the essential difference between the feature and its source material: whereas the short was a two-and-a-half minute scare machine, the full-length film presented an opportunity for Sandberg to say something more meaningful while still scaring audiences out of their wits.

While the metaphor is never explicitly spelled out, Sophie's mental illness is a central feature of the script, dramatized via half-empty prescription bottles and the eventual explanation of her tortured backstory: while confined to a psychiatric hospital as a child, Sophie befriends Diana, a dark-haired young girl who suffers from a rare disorder that makes her ultra-sensitive to light. After the two girls form a close bond, a tragedy at the hospital seemingly takes Diana out of the picture -- except that for Sophie and her two children, Diana continues to live on as a vengeful, potentially deadly presence.

Given the weighty themes in play, when it came time for Heisserer to flesh out the director's ideas, he made the decision to write the script as a family drama first -- a move that provided him with a template for where to insert the scary stuff: "Once I...figured out the bones of that and how the characters evolved...It was a little easier to go back and find all the points where the dramatic tension was the highest between these characters," he told me. "And [then] I knew where to plant the scares."

Despite crafting Lights Out around some weighty issues, Heisserer was clear that they didn't want the film to be "overtly message driven," and in that sense they succeeded. Though she's given her own tragic history, Diana never completely registers as a sympathetic, fully fleshed-out character in her own right; she's ultimately more monstrous than pitiable. At the end of the day, Lights Out has to work as a horror movie first, and as far as Heisserer is concerned, hammering audiences over the head with the metaphor was less preferable than the idea that many who see it simply won't take anything more from the film than the abundance of surface-level frights it has to offer.

"If we can get people to enjoy [the film] on more than one level, hopefully people find it enriching like that," said Heisserer. "[But] that's not up to me. That's absolutely up to them."

Lights Out is in theaters today.

A former contributor to sites including MTV's The Backlot and Bloody-Disgusting, Chris Eggertsen worked in film development before indulging his love of pop culture writing full time. He specializes in horror, the intersection of social issues and entertainment and Howard Stern. He's on Twitter @HitFixChris.