A girl and her friends find a game in the attic that summons a creature known as The Midnight Man, who uses their worst fears against them.
On a winter night in 1953, three children, Anna, her brother Max, and their friend Mary, are playing a demonic game in Anna's attic, sitting inside a circle of salt while struggling to light candles to fend off the Midnight Man, who kills Mary and chases the others; Max leaves by the main door, violating the rules, hence also being killed.
In the present, on another winter night, in the same house a senile Anna is put in bed by her granddaughter, teenager Alexandra 'Alex'. Over the phone Alex's friend Miles offers to come. Alex hears noises and comes to Anna, who asks her to fetch her hand mirror from an old chest in the attic. Alex looks in the chest, finding some relics including a shotgun and bullets, along with the hand mirror and a mysterious box tightly shut. Miles joins her and opens the box, finding old photos, candles, matches, a salt shaker, and a torn sheet of paper with the rules to play 'The Midnight Man', along with another sheet with a few names and a drop of blood next to each. Anna catches them and reacts in horror before fainting.
Dr. Harding, an old family friend and his assistant Alan, summoned by Alex, check on Anna and give instructions for her care. Harding offers Alex his condolences for her mother's death when she was a child and leaves with Alan. Miles and Alex, moved by curiosity, start following the rite described in the rules to the game, adding their names and blood to the list and rapping at the front door at midnight while Anna overhears them from her room. They light the candles and wait, but only hear Anna speaking on the interphone. Alex comes to her again while Miles looks for the missing part of the rules but she finds the room empty and searches in the bathroom, where the Midnight Man corners her soaking her in blood as Anna blows out Alex's candle. Miles, still in the attic, finds the second, grimmer part of the rules; he blows out his own candle to test the game and is also tortured by the Midnight Man, who inflicts pain on him. Miles escapes and comes to Alex; they both realize the game is real.
Their friend Kelly arrives, as Miles had invited her over earlier, and they explain the game to her. Incredulous, she nonetheless joins the game for fun, despite their warnings. They walk into a room full of pipe leaks; their candles go out briefly as the Midnight Man approaches and reveals himself only to Alex as she looks into the hand mirror; a leak blows Kelly's candle out, and as they fail to relight it, they make a circle of salt around her and leave to search for another candle. The Midnight Man appears and throws water which breaks the circle, managing to attack Kelly with visions of a conny she killed when she was a child. Alex and Miles, unable to find more candles, run into Dr. Harding in the sitting room; he explains that he knows about the game since he was present on the night Anna played it for the first time, although she hadn't allowed him to join the game, and that she has kept playing over the years, luring more people into it including her own daughter, Alex's mother, who hung herself in front of Alex, pushed to it by the Midnight Man, who, as Harding tells them, does not accept defeat.
Alex, Miles, and Harding find Kelly with her throat slit; Harding urges them to destroy the game, but Anna reaches them in the attic as the two former draw another circle of salt; she beats Harding to death before being shot dead by Alex with the old gun. The Midnight Man shows up and taunts them; the clocks strike announcing 3:30, three minutes before the game ends, and the Midnight Man leaves; they wait out and leave the circle at the strike of 4 o'clock. Miles notices Harding's watch which reads 3:27, realizing that they were tricked by the Midnight Man, who kills him and confronts Alex, telling her the game is over.
Some time later, Alan and his son are in a garage sale at the house; Alan tells his son that he knew the people who had lived there, while the boy finds the box once more tightly shut, shaking it before asking if he can take it. Alan agrees and they leave, as the kid says he hopes it's a game.