In the space of a week or so, Clare Shannon, the teenage heroine of “Wish Upon,” suddenly gains a new house, a hot boyfriend and an inexplicable level of popularity. There’s a reason, she confides to her friend Meredith: Clare possesses an ancient Chinese music box that will grant her seven wishes, though each comes with a price — in blood.

“That’s messed up,” says Meredith (Sydney Park). “I would have wished for world peace or a cure for cancer.”

advertisement | advertise on newsday

Yeah, right! Any high-school kid would wish for the same things Clare (Joey King) does: money, friends, requited love, sweet revenge, maybe a cooler dad (Ryan Phillippe plays the shabby Jonathan Shannon). Our empathy with Clare — almost a shared guilt — is what pulls us through this modest gem of a horror-comedy. With a devilish sense of humor, a clear affection for its teenage characters and just the right touch of gore, “Wish Upon” is a clever combination of W.W. Jacobs’ “The Monkey’s Paw” and Tina Fey’s “Mean Girls.”

It might sound odd to call a horror movie “sweet,” but in many ways, the shoe fits. That’s partly due to the youthful cast. Shannon Purser (Netflix’s “Stranger Things”) plays June, Clare’s plain-Jane friend and better angel; Ki Hong Lee (“The Maze Runner” films) is Ryan, an amiable dude with a crush on Clare; Park gives Meredith a likable sassy streak. As for King, she makes us believe in Clare even as she goes through three distinct phases: the mopey loner, the popular queen bee and the haggard wish junkie who can’t let go of her precious box.

The director, John R. Leonetti, once turned a clichéd script about a creepy doll into the surprisingly effective chiller “Annabelle” (2014). Here, he has a far smarter screenplay, from Barbara Marshall (“Viral”), and seems to be having great fun, especially when forcing us to guess how the next victim will meet her doom. Will it be the over-boiling stockpot or the malfunctioning garbage disposal? Leonetti draws out the tension for so long that the effect becomes not just comedic but borderline hysterical.

“Wish Upon” eventually breaks its own rules and plays loose with logic, but none of that spoils the fun. In this somewhat disappointing summer at the movies, “Wish Upon” offers a welcome glimmer of magic.