In the small New England town of Blithe Hollow, Massachusetts, a boy named Norman Babcock is able to speak with the dead, including his late grandmother and various ghosts in town. Unfortunately, almost no one among the living believes his ability is genuine and he is isolated emotionally from his family while being ridiculed and bullied by most of his peers for his seemingly strange abilities.
However, Norman makes a friend with Neil Downe, an eccentric overweight boy who is bullied himself and finds Norman's earnest admission as a medium an intriguing part of a kindred spirit. During rehearsal of a school play commemorating the town's witch execution of 300 years ago, Norman has a harrowing vision of the town's past and being pursued as a witch by the town's citizenry. Afterward, the boys are confronted by Norman's estranged and seemingly deranged uncle Mr. Prenderghast who tells his nephew that the vision is a sign that he soon must take up his regular ritual to protect the town.
Norman refuses to take him seriously, but soon has another vision during the school play, creating a public spectacle of himself which leads to his embarrassed parents unjustly grounding him. Now completely despondent and isolated, Norman is confronted by the ghost of the recently deceased Prenderghast in the restroom who tells him that the ritual must be performed with a special book before sundown that day, before departing for the afterlife. After some consideration, Norman sets off to Prenderghast's residence to retrieve the book. Believing that Neil would not truly understand his situation, he drives him away. He arrives at the graves of the town's ancestors/founders, including Judge Hopkins, who were supposedly cursed by the witch they condemned, but finds the book is merely a collection of fairy tales.
Before Norman can ponder the situation, Alvin, a bully who overheard Norman's encounter in the restroom, intrudes and interferes with the reading until after sundown. With that, a ghostly storm resembling the witch appears in the air while the cursed dead arise and pursue the boys until they meet Norman's sister, Courtney, Neil and his older brother, Mitch, who have come to retrieve Norman. Together, the kids are relentlessly pursued by the zombies into town, but Norman manages to contact a classmate named Salma, who tells them to access the Town Hall's archives for the location of the witch's unmarked grave.
As the kids make their way to the Town Hall, the zombies eventually lose them and find themselves confused by modern society and then are beset by the citizenry, who attack them en masse. During the riot, the kids break into the archives but cannot find any information they need. As the mob moves to attack Town Hall, Norman (in frustration) temporarily drives away his companions only for them to be trapped by the mob. However, the Witch storm appears and Norman climbs the Hall's tower to desperately attempt to read the book to stop her, but the witch blasts it with lightning and causes him to fall back down into the archives.
Unconscious, Norman has a dream where he learns that the witch was actually Agatha Prenderghast, an innocent little girl of his age who was also a medium, unjustly condemned by the town's superstitious and frightened elite, who were then cursed to reawaken as the undead by Agatha as she was taken for execution. After awakening, Norman encounters the zombies and realizes that all they wanted was to speak with him to ensure he would take up the ritual to minimize the harm of the terrible mistake they made with Agatha. However, Norman decides that this gesture is not enough and resolves to find Agatha's ghost to arrive at a permanent solution.
Norman attempts to help the zombies slip away to have them guide him to Agatha's grave, but are cornered by the mob. However, Courtney, who has come to realize her brother's true abilities, heroism and task, confronts the crowd and convinces them to back off. As the witch storm rages ever more destructively, Judge Hopkins guides Norman's family to the grave in a forest. Unfortunately, Agatha's magic separates Norman from the others and he must reach the grave on his own to save the town.
Norman finds the grave, and soon confronted by the vengeful spirit of Agatha, interacting with her in the spirit dimension. She tries to drive him away, but Norman resolutely holds his ground, telling her that he understands how she feels as an outcast. As she struggles to drive him away, Norman endures her assault and eventually convinces her that, despite her legitimate grievance, her thirst for vengeance is accomplishing nothing but inflicting more pain and persuades her to stop. Norman tries to convince her that even in the darkest times, there must have been someone who was kind to her. Focusing only on the tragedies and forgetting the good things in her life is what reduced her to a malevolent force devoid of her true identity.
Eventually, the girl, nicknamed Aggie, calms down at Norman's eloquence, recalling her true personality and happy memories with her mother. She is able to find a measure of peace, knowing that she is not alone and one person in the town understands her, allowing her to let go and move on to the afterlife. At that resolution, the storm dissipates, and she and the zombies all peacefully fade away. As day breaks, the town cleans up and regards Norman as a hero even when the outside media tries to explain the disturbance as merely a powerful storm.
Norman, realizing that he, too, should stop focusing on his memories of being ostracized and pushing others away, accepts Neil's companionship. At the end, Norman watches a horror film with the ghost of his Grandmother again, and his family eagerly joins him.