“Pain & Gain” is the darkest of comedies set in brightest Miami about gruesome crimes committed by the dimmest of bulbs.

It’s ferociously funny for much of its length, which is not what we’ve come to expect from Michael Bay, the director of “Armageddon” and the “Transformer” pictures. Not exactly laugh riots, those epics. At least not intentionally.

But in “Pain,” Bay serves up a crooked crew of steroid-addled bodybuilders whose intellects are as puny as their muscles are massive. Played by a bulked-up Mark Wahlberg and Anthony Mackie and the gigantic Dwayne “The Rock” Johnson, the trio cooks up a kidnap/extortion plot targeting a shady entrepreneur played by Tony Shalhoub. It’s all fun and games up to the point where, with one disguised as an Area 51 big-eyed green alien, the three nearly botch the abduction.

They finally drop the victim with a Taser and hustle him off to a deserted warehouse to be … extensively tortured. Absurdity prevails in the torture scenes, especially when the dolts use sex toys as bludgeons. Bizarre! Yet funny.

Unlimited Digital Access. $1 for 4 weeks.

Things escalate. Murder is attempted, and committed. Chain saws enter the picture. Are you ready for some dismemberment?

The rough stuff is handled in such a way that it all plays as a kind of clown show. Barbecued appendages, anyone?

What Bay has done by casting such likable stars as Wahlberg and the Rock and having them behave in oafish ways is he makes them sympathetic. The victims, not so much.

So the audience is prompted to laugh at the mayhem. But here’s the thing: The events depicted actually happened in the mid- ’90s. The movie tells us this, twice, in title graphics, one of which reminds us, as really bad things happen, “This is still a true story.”

The more one learns about the actual crime, the more queasy one feels about having, in a sense, been taken in Bay & Co. “Pain & Gain” is, then, a sick joke: skillfully made, genuinely funny and appalling for making light of true horror.

Soren Andersen: asoren@yahoo.com