THE REVIEW: Making a good black comedy is all about nailing tone. It’s tricky work, mining the worst of human nature for laughs without coming across as cruel or crass. When you think of masters of the form, you think Stanley Kubrick. You think the Coen brothers. You probably don’t think Michael Bay.

“Pain & Gain” proves why.

The film is a curious departure for Bay, a veteran of the “things blowing up real good” school of fratboy filmmaking (“Bad Boys,” “The Rock,” “Transformers”). With a reported budget of $26 million — a far cry from the hundreds of millions Bay commands for the “Transformers” movies — “Pain & Gain” is, at least in Bay’s universe, nearly an indie film (case in point: only one car blows up). But you can’t thread a needle this fine with a script filtered through Bay’s puerile id.

What makes nailing the delicate tone even trickier is that “Pain & Gain” is based on the true story of a trio of weightlifters-turned-criminals. Mark Wahlberg stars as chief meathead Daniel Lugo, a budding con artist and personal trainer at Sun Gym. He’s the sort of dope who idolizes the likes of “Scarface’s” Tony Montana and the Corleones, self-made men who carve out success in the world with machine-gun fire.

He sees an easy way out of his mounting bills in one of his clients, Victor Kershaw (Tony Shalhoub), an unctuous skeezball with a healthy bankroll and a profitable Schlotzsky’s franchise. Lugo recruits two buddies to his cause. There’s Adrian Doorbal (Anthony Mackie), a fellow trainer desperate for cash to fix the erectile dysfunction brought out by his steroid abuse. And there’s Paul Doyle (Dwayne Johnson), a fresh-from-prison, born-again Christian who’s having trouble adjusting to the real world.

Together, the men hatch a plan to rob Kershaw of his enviable life. Well, “plan” is maybe too generous a word for kidnapping a guy, torturing him into signing away his worldly possessions and then just expecting not to get caught.

(Page 2 of 2)

There’s a certain kinetic charm to the first half of the movie, a freewheeling silliness to these outsized characters that makes you curious to see just how wrong things will go. But as the weightlifters’ plot spirals out of control, so does the movie’s. It goes on far too long, for one thing — two-plus hours is a long time to spend trapped in a Bay movie where the script is the driving force.

And that script starts to become downright uncomfortable as the tone unravels. Even Johnson, who can be deeply entertaining as a coked-out Jesus freak criminal (“Jesus Christ has blessed me with many gifts. One of them is knocking someone the (expletive) out”), gets a bit skin-crawly when, in a moment of gay panic, he beats the snot out of an elderly priest for overly admiring his pectoral muscles. With such a whacked-out tone, it’s unclear whether the movie plays this out as a commentary on Johnson’s character or just does it for yuks.

Of course, that’s only one tasteless moment in a cesspool of tasteless moments. It gets to feel like the sort of movie a teen boy would make if you gave him tens of millions of dollars, a boxful of Playboy magazines and a couple cases of Red Bull, complete with naked chicks, dirty jokes, rape jokes, ninja costumes and slapstick and bathroom humor, all seasoned with a soupcon of homophobia and misogyny.