“Tyler Perry’s Boo! A Madea Halloween” just barely scared away Tom Cruise’s “Jack Reacher: Never Go Back” with $9.4 million on Friday night, setting the stage for a heated box office battle as the weekend goes on.

Heading into the weekend, it looked as though “Never Go Back” would just have the edge over “Madea.” The Paramount sequel, however, was close behind with $8.9 million on 3,780 screens for Friday night. Lionsgate’s “A Madea Halloween” is looking at $25 million for the three days, with “Never Go Back” heading toward about $23 million for the weekend. The two movies opened Friday roughly in line with pre-weekend projections, which had them both debuting in the $8 million-$9 million range.

Meanwhile, horror prequel “Ouija: Origin of Evil” grossed $5.5 million to come in third place. It opened in 3,167 North American theaters on Friday, and should be headed for a $13 million weekend.

Another newcomer, Fox’s “Keeping Up With the Joneses,” may have trouble returning a profit on its $40 million production budget, earning $2 million on Friday after opening on 3,022 screens. It’s looking at an opening weekend around $6 million. The comedy stars Jon Hamm, “Wonder Woman” star Gal Gadot, Zach Galifianakis, and Isla Fisher, and follows what happens when a suburban couple begins to suspect that their neighbors are spies.

Perry returned to write, direct, co-produce, and star in “A Madea Halloween,” which opened on 2,260 screens on Friday and cost about $20 million to produce. The newest film in the franchise was based on an idea featured in Chris Rock’s 2014 film “Top Five.”

The previous eight films in the franchise have garnered nearly $380 million globally in total. The Madea character originated in the 1999 play “I Can Do Bad All by Myself.”

“Never Go Back” sees Tom Cruise return as the titular ex-United States Army Military Police Corps major who must uncover the truth behind a government conspiracy in order to clear his name. The action movie, which has a budget of $60 million, also stars Cobie Smulders, Patrick Heusinger, Aldis Hodge, Danika Yarosh, and Holt McCallany.

The first “Jack Reacher” ended up as a money maker for Paramount in 2012, grossing $218.3 million worldwide on a production budget of $60 million. Edward Zwick took the directing reins from Christopher McQuarrie in the latest in the series, based on the books by Lee Child.

“Ouija: Origin of Evil” comes from Blumhouse, Platinum Dunes, and Hasbro, and follows a family who, in an attempt to boost their seance scam business, unwittingly invite evil into their home when a malicious spirit possesses the youngest daughter.

The first film, 2014’s “Ouija,” was a commercial success for its distributor Universal, despite being panned by critics. It grossed $103.6 million worldwide on an economical $5 million production budget.