‘The Way, Way Back’: On the beach with Sam Rockwell, Steve Carell

“The Way, Way Back” is a sunny wonder, a movie made for virtual pocket change (less than $5 million) that effortlessly out-classes such floundering box-office behemoths as “The Lone Ranger” and “White House Down.” The script, by actors Nat Faxon and Jim Rash, who also directed (and gave themselves a pair of funny supporting roles, as well), is a feast for the lively cast, and you can feel them reveling in it. Soon you are, too.

The movie captures the great American seashore vacation — the breezy boat docks, the twilit dunes, the grown-ups cocooned in a boozy haze while their children die of boredom — in all its torpid glory. Steve Carell plays Trent, a self-regarding car dealer who has driven in from Albany, N.Y., to spend the summer at the big shake-shingle beach house he maintains not far from Cape Cod. With him are his grumpy teenage daughter, Stephanie (Zoe Levin); his similarly divorced girlfriend, Pam (Toni Collette); and her 14-year-old son, a slumpy introvert named Duncan (Liam James of AMC’s “The Killing”). Trent and Pam have been together for a year, and Trent has let it be known that marriage is in the offing. Pam longs for that sort of stability, and she has forced herself to ignore Trent’s cold arrogance, especially toward her son. (Ranking Duncan on a scale of 1 to 10, Trent pronounces the hapless kid a 3 — to his face.)

Carell weaves not a thread of comic embroidery into this unpleasant character, and he never seeks to outshine the movie’s tightly meshed ensemble. James gets most of the movie’s face time (he’s a little listless at first, though it’s not for long), but its real star — through sheer force of improvisational spirit — is Sam Rockwell. He plays Owen, the coolest employee at a local amusement park called Water Wizz. When Duncan, desperate for something to do, wanders into this merry place and Owen spots him as a sad sack in need of shoring up, the movie really takes off. Rockwell flicks out quips like firecrackers (“What happens in the tubes stays in the tubes!” he informs some young patrons at the top of a big waterslide), and he’s a master of spiraling verbal anarchy (the scene in which he baffles a crowd of kids with an extended riff on an ’80s pop song they’ve never heard of is all the more brilliant for coming totally out of the blue).

Like most of the film’s other characters, though, Owen is more than just a snappy-patter machine. He has worked too long at the water park, and his patient girlfriend, a fellow employee named Caitlyn (Maya Rudolph), is growing weary of waiting for him to get his life together and move on. Back at the house, we meet a blowsy neighbor named Betty (Allison Janney), whose husband left her for another man and who is doing battle with middle age on a roiling sea of cocktails; she’s funny, but we can see she’s just trying to cope in the only way she knows how. Betty’s teenage daughter, Susanna (AnnaSophia Robb), befriends the lonely Duncan and shares his dismay with all the alcoholic summer antics going on. (“It’s like spring break for adults,” she says.) There’s also Betty’s feisty little son, Peter (River Alexander), who won’t let an eye patch hold him back, and there’s a wandering wife (Amanda Peet) who finally throws Trent’s real character into harsh relief.

The story is a familiar comedy archetype (it’s “The Summer I Came of Age”), and the movie’s low-key sweetness recalls such films as “Adventureland” and “Little Miss Sunshine” (in which Carell and Collette also featured). But the characters are subtly detailed; the situations are freshly engaging; and Rockwell, who never has been bad in anything, has rarely, if ever, been better than he is here. Fans will recognize this as a serious recommendation.