No matter what else happens in Soul Men, it's hard not to be moved by the posthumous performances of Bernie Mac and Isaac Hayes, especially when they appear onscreen together, and more so when, in one scene, they leave a room together. At other times, however, Mac is at the top of his comedic game. He has the power to make us forget that anything is wrong in the world, including the fact that it has lost two of its best and brightest.

In Soul Men, Mac plays Floyd Henderson, one third of a legendary 1960s soul music trio. In the 1970s, the group's lead singer Marcus Hooks (played in flashbacks and photos by John Legend) embarked upon a solo career, leaving Floyd and his bandmate Louis Hinds (Samuel L. Jackson) in the lurch. They tried to continue alone, but quickly broke up due to "creative differences," i.e. they fought over a woman. Now Marcus has passed away and Floyd and Louis have been invited to perform in a tribute show at the Apollo. And since Louis doesn't fly, they must drive cross-country, which gives them plenty of time to fight and bicker. (Isaac Hayes appears relatively briefly, as himself, at the tribute.)

The movie isn't clear just who this fictional band was. It credits them with real songs, like "I'm Your Puppet" (actually recorded by James and Bobby Purify), and their fake history echoes other bands that existed, yet they also exist among real bands (Funkadelic is referenced, along with Hayes). No matter. It comes down to Jackson and Mac's chemistry, which they have in gobs; they reminded me of funkier versions of Lemmon and Matthau's Grumpy Old Men. Soul Men doesn't disguise the fact that neither Jackson nor Mac have the pipes of a Smokey Robinson or an Al Green, but they can carry a tune, and they sound good together. Their best onstage moment comes in a redneck bar. We expect the hicks to start hurling empty Bud bottles at the stage, but these consummate performers quickly and easily get the crowd on its feet. To my great astonishment, I discovered that I was grinning throughout.

Mac and Jackson are even better offstage. Though Jackson isn't strictly a comedian, both actors are masterful at line deliveries. They make written dialogue sound like their own words, and they have a delirious sense of timing (think of Jackson's line deliveries in Jackie Brown, for example). What's more, they make the most creative use of curse words the movies have heard in some time. (One white character says of them, "they say 'motherf---er' a lot.") When these characters spend time just talking, or arguing, they make a terrific match. One of their funniest scenes comes while killing time in a strange and unique hiding place near the movie's end.

Alas, that's where the trouble comes in paradise. Apparently it's not possible in Hollywood to make a joyous movie about two fun guys arguing and occasionally singing. You have to have subplots and lessons learned (lies and misunderstandings uncovered), and you have to have other characters. And here the movie goes wrong. Sharon Leal plays the daughter of the woman that Floyd and Louis fought over (and I'm not giving much away by suggesting that she's probably the daughter of one of the men). And of course, she sings, and she sounds exactly like most of the recent "American Idol" contestants. And her boyfriend, Lester (Affion Crockett), is an annoying, posing rapper who irks our heroes with his toneless rhymes and clichéd behavior. They dispatch him once, but the movie actually brings him back again during a late second-act lag.

It goes on. Sean Hayes plays a soulless music executive who is alternately affectionate and cold toward the boys, and Adam Herschman plays a music intern (with a "Jew-fro," perhaps hoping to cash in on Superbad fever) who idolizes Floyd and Louis. Mike Epps appears briefly as Floyd's nephew, who plunks Floyd in a retirement community. Jennifer Coolidge plays a bar hag who seduces Floyd. We get lots of sex and Viagra jokes, and a couple of requisite bodily function jokes (Floyd gets a two-finger/rubber glove/lubricant checkup at the doctor's), and none of it works as well as the organic back-and-forth between the two talents.

Director Malcolm D. Lee (Spike's cousin) gave us the dismal Welcome Home Roscoe Jenkins earlier this year, as well as the very funny Undercover Brother several years back; he seems to wrestle back and forth between following his instincts and pandering to the audience. Soul Men reminded me of Chris Rock's I Think I Love My Wife, in which Rock made an earnest, admirable attempt at a grown-up comedy, but then felt compelled to insert dumb, juvenile jokes (including more Viagra jokes) as a way to appeal to younger (or broader) audiences.

Sadly, this stretches all the way to the end credits of Soul Men, when Lee makes a heartfelt, but mawkish attempt to pay tribute to Mac. A simple title card: "For Bernie Mac and Isaac Hayes" would have said volumes, but instead Lee gives us interview clips (Mac summing up life's work) and shots of Mac clowning on the set, and the effect is... what? Funny? Sad? More like confusing, and definitely out of step with the movie's happy ending. Once again, these are competing instincts. Lee wants to give us everything he's got, everything he collected on the set and everything he knew about Mac, without ever realizing that the simplest, most honest gesture could be far more powerful and lasting. Bernie Mac, just by being in this film and making us laugh and smile one more time, has given himself the best of all eulogies.