‘Bad Boys: Ride or Die’ is about redemption. Hmm.

Every long-running action franchise reaches a point where the main character groans that he’s too old for this. In “Bad Boys: Ride or Die,” Martin Lawrence takes it one step further, and you should stop reading here if you want the details to come as a surprise.

Minutes into this fourth installment, Lawrence’s Miami detective Marcus Burnett clutches his heart at the wedding of partner Mike Lowrey (Will Smith) and drops dead. The series that never says no to a bikini montage suddenly becomes metaphysical. Returning directors Adil El Arbi and Bilall Fallah (“Bad Boys for Life”) deliver a surprisingly evocative scene in the underworld, imagining the Great Beyond as a haunted Margarita Villa. The ghost of Marcus and Mike’s former captain (Joe Pantoliano), killed in the last film, 2020’s “Bad Boys for Life,” is spotted kicking him on the beach with a (presumably dead) parrot.

Never be afraid. Given the two choices in the title, Marcus chooses to continue driving. He’s revived, well, revived, waking up with the energy of a Ziegfeld girl and dancing through traffic while bragging about his immortality. Lawrence’s high spirits also defibrillates the franchise. Turns out the Bad Boys movies needed less swagger and more dorky, goofy joy.

But in reality, this is the resurrection of Will Smith. “Ride or Die” is his first popcorn movie since winning an Oscar and tarnishing his reputation that same night. Smith seems chastened in a film whose script (by Chris Bremner and franchise newcomer Will Beall) is very much about forgiveness. “I had a lot to do growing up,” Mike admits to his ex-girlfriend and police colleague Rita (Paola Nuñez), at his wedding to a new beauty named Christine (Melanie Liburd). Rita’s answer is curt, but friendly: ‘It was 50.”

The story, as always, revolves around drug cartels and kidnapped women. (We enjoy the film most for the jokes that have little bearing on the plot.) A cabal of thugs has posthumously disgraced Pantoliano’s Captain Howard, a boss so beloved that his framed portrait appears to give Mike away at the altar . Rebuffing Howard’s reputation (yay, what a coincidence!) gives Mike and Marcus an excuse to call a truce with his killer, Armando (Jacob Scipio), who also happens to be Mike’s estranged son. As Mike and Marcus make their way through Florida with Alexander Ludwig and Vanessa Hudgens as their millennial sidekicks, Pantoliano pops up in tricky video diaries to urge his protégés to move on. “Please, guys, you’re my last hope,” he says. He’s Princess Leia with a flat top.

El Arbi and Fallah are not reinventing the wheel; they just install shinier rims. The young directors were both under 10 when the first “Bad Boys” hit theaters in 1995 and play with the franchise like kids in a sandbox, giving showy scenes to favorite characters like Marcus’ embittered son-in-law Reggie (Dennis Greene). and a stunningly tall hacker named Fletcher (former NBA star John Salley, one of the Detroit Pistons’ original Bad Boys).

Cinematographer Robrecht Heyvaert respects the series’ visual tics: night scenes with the lurid pink and teal of a souvenir T-shirt, daytime under that searing orange hue that seems washed with nacho cheese, and comic angles that photograph people as skyscrapers or ants , anything but human size. Since our two leads aren’t in the mood for intense choreography, most of the fights consist of a lot of bludgeoning gunplay. The camera is more athletic than anyone on screen, muscle between bullets and punch through walls. Heyvaert shoots action so well that you forgive how little physical action there actually is.

Smith seems wary of having too much fun in his apologetic blockbuster. (His character now suffers from panic attacks, a point that is made often and means nothing.) So Lawrence launches into the film’s silliest jokes, yelling at alligators, drooling over gas station hot dogs and going on about how he now believes in fair …to-Hades soulmates. “We haven’t always been Mike and Marcus, but we have always been us,” he says, beaming.

Lawrence enjoys himself twice as much as Smith and marginally more than the audience. During a gunfight, he desperately flicks his tongue as jelly beans fly through the air. It’s a nice metaphor for how the summer multiplex is starving for this kind of enjoyable junk.

R. In theaters in the region. Contains language and violence that makes that Oscar night look like a friendly high five. 115 minutes.