“The Way, Way Back” is a nifty blend of humor, heart and drama. The title refers to the far-rear seating in vintage station wagons where riders — usually the littlest kids in the clan — faced the tailgate window. It also captures the film’s nostalgic appeal. It’s a throwback to the heyday of John Hughes and “Risky Business,” when coming-of-age stories had a sense of comic naturalism, pungent characters who stay with you and significant emotional stakes. This is a very funny movie with serious things on its mind.

The adolescent in focus is disillusioned, eye-contact-avoidant Duncan (Liam James, wonderfully artless). He doesn’t know why his mother Pam (Toni Collette) and his father split. He can’t fathom why she’s with her jerkish new boyfriend Trent (Steve Carell, playing it straight). Girls — no clue. He is early-teen anomie incarnate.

Over the course of an extended stay at Trent’s East Coast vacation home, Duncan struggles to cope with adult situations that even adults can barely navigate. The summer of his discontent is handled with a winning balance of testiness, warmth and bruised wisdom about the ways of the world.

Nat Faxon and Jim Rash, who shared writing and directing duties, have a sharp eye for the dynamic between kids, parents and unrelated adults. There’s not a scene that isn’t a subtle power play of some kind.

When Pam is asleep, Trent tells her insecure son that on a 10-point scale, he’s about a 3, so he should use this getaway to work on himself. The house fills with “Oh, hi, kid” neighbors so Duncan rides aimlessly on a pink-decorated girl’s bike — his escape vehicle. None of the grownups notices his almost daily disappearances.

Wheeling up to a water park, he comes under the wing of the manager, a breezy, don’t-give-a-damn lifer named Owen (Sam Rockwell, channeling the motormouth Bill Murray of “Meatballs”). And bit by bit, everything changes.

Rockwell’s life-of-the-party performance dispels the precisely crafted gloom of the opening scenes like a broiling summer sun. He tosses a little light wisdom at the kid but mostly counsels him to have fun and take chances. They don’t all turn out as planned. The resolution of his tentative relationship with a boozy divorcée neighbor’s captivating daughter (AnnaSophia Robb) is a pleasing curveball. All in all, though, it opens the kid up. His self-protective slump lifts. Glimmers of repressed personality burst forth. The script doesn’t stack the deck so that Duncan suddenly triumphs, but you know he’s going to be all right.

The thing that sets this movie apart from most summer comedies is that every character has an extra dimension or two (Faxon and Rash shared a screenwriting Oscar for 2011’s “The Descendants” with director Alexander Payne). There’s a rueful side to wiseacre Owen. Collette plays Pam’s compassion, forced cheer, desperation and inner-directed anger so fluently that at times she’s on all four bases at once. Even obnoxious Trent has a vein of sadness to him.

Like the earlier Carell-Collette hit “Little Miss Sunshine,” this is a romp that will have you reaching for your handkerchief.