Ben Stiller and Vince Vaughn switch their usual places in "Dodgeball: A True Underdog Story." In most of their comic collaborations, Vaughn has played the villainous smoothie while Stiller works up a clench-jawed head of steam as the put-upon loser. Here, Vaughn is the hapless hero while Stiller happily hams it up as a fatuous, pumped-up phony. The turnabout works, at least to a point, in this modestly amusing teen summer comedy.

Vaughn plays Peter LaFleur, the owner of Average Joe's Gym, where a gang of misfits gathers daily to escape domineering wives, empty lives, the cruelties of high school or just reality itself (one of the gym's patrons is totally accepted as the pirate he thinks he is). Across the street, White Goodman (Stiller) holds court at Globo Gym, a sleek, purple-swathed palace of narcissism whose motto is, "We're better than you -- and we know it!" Goodman, a former fatty, oversees his empire through a combination of insecurity and overweening ego while sporting an absurdly puffy '70s hairstyle, right down to the Fu Manchu mustache. When LaFleur's elastic bookkeeping habits result in Average Joe's coming into foreclosure, Goodman moves in for the kill, buying up the mortgage to build an additional garage for his gym rats.

LaFleur must come up with $50,000 in 30 days to pay off the bank, and as it happens one of his customers subscribes to Obscure Sports Quarterly; that's where the Average Joes learn about an upcoming dodgeball tournament whose purse happens to be exactly the sum they need. They begin training, and their efforts land them in the heart of Las Vegas, where they manage to win their way to the finals to meet their ultimate match: Goodman's own Purple Cobras. The Joes' motto: Aim low. (The games, by the way, are broadcast on ESPN 8, the "Ocho," which gives the dodgeball playoffs all the graphic gravitas and breathless color commentary of the Super Bowl.)

The funniest moments in "Dodgeball" belong to Stiller, note-perfect as an arrogant fathead who tries to impress a pretty banker (played by Stiller's wife, Christine Taylor) by filling an inflatable codpiece and reading the dictionary ("I try to stay in mental shape, too"). And writer-director Rawson Marshall Thurber, who makes his feature debut here, sneaks in some improbably subtle humor, such as a 1950s-era training movie produced by "Uber-American Instructional Films" that proudly describes dodgeball as "a sport of violence, exclusion and degradation." Some of his jokes are so quick they almost disappear; "Dodgeball" may be the only bonehead comedy in history, or at least this summer, to refer in passing to Sappho and schadenfreude.

But for the most part, the movie is a series of setups for snickering sexual humor and vicariously aggressive ball-throwing. LaFleur's team winds up training with legendary dodgeball champion Patches O'Houlihan (Rip Torn) by dodging wrenches and oncoming traffic; then they go head-to-head with teams from Germany, Japan and the African American community. Those matches provide opportunities not only for countless sight gags involving men's nether regions, but for some tired ethnic humor as well.

Most viewers can predict what fun the filmmaker has with the object referred to in the title and its various double meanings, but you have to see "Dodgeball" to believe what Lance Armstrong, William Shatner and Chuck Norris are doing in the same movie. Balancing lightly between clever and stupid, Thurber never quite manages to make "Dodgeball" soar, but he never entirely lets it sink, either.

Dodgeball: A True Underdog Story (91 minutes, at area theaters) is rated PG-13 for rude and sexual humor, and language.

Ben Stiller gets the best moments as a gym owner trying to flatten the competition.Vince Vaughn is the hapless owner of Average Joe's Gym in "Dodgeball."