Duncan (Liam James) finds a friend in Susanna (AnnaSophia Robb) during his summer on the Massachusetts shore in “The Way, Way Back.” (Claire Folger)

Adolescent disaffection, adult cluelessness and the fleeting pangs of summer romance spring palpably to life in “The Way, Way Back,” a coming-of-age drama that manages some genuinely surprising turns despite the formulaic road it travels.

That road is literal in the film’s opening scene, in which 14-year-old Duncan (Liam James), on his way to a cramped, damp summer on the Massachusetts shore, is trapped in a car being driven by his mother’s boyfriend, Trent (Steve Carell).

While Duncan’s mom, Pam (Toni Collette), naps, Trent is haranguing Duncan about his social skills, sharply asking the teenager how he would rate himself on a scale from 1 to 10, then volunteering that he’d give Duncan “a 3.” Trent is a nasty piece of work, judgmental and rigid, traits no less eloquently telegraphed for the fact that much of the sequence is filmed showing only his sharply accusing eyes in the rearview mirror.

Once arrived at “Riptide,” Trent’s cottage, the group is immediately set upon by Betty (Allison Janney), Trent’s blowsy neighbor who’s a compulsive hugger and prodigious tippler, and whose motto is: “Accept it and move on.” While Trent and Pam become absorbed in the beach town’s social life, Duncan gets busy being rejected by Trent’s daughter’s clique, although Betty’s daughter, Susanna (AnnaSophia Robb), shows some potential for self-awareness. Desperate for escape, Duncan bicycles away from the compound one day, finally finding himself — literally and figuratively — at the Water Wizz, a vintage water park overseen by a perennial teenager named Owen (Sam Rockwell).

Directed by Jim Rash and Nat Faxon from their own script, “The Way, Way Back” is a modestly engaging summer romance, not just between Duncan and the unattainable Susanna but also between Duncan and Owen, who becomes a surrogate father, big brother, party buddy and first boss, all in one. Rockwell, taking on a role that Bill Murray might easily have inhabited in his own arrested youth, jokes his way through a subtly sympathetic performance as a scruffy Peter Pan getting by on charm and mordant one-liners. Janney delivers a liberated turn as the sun-burnished, boundary-challenged Betty, who masks formidable feminine rage under her sarcasm and ill-fitting resort wear. And James brings considerable pathos to a young man in the midst of transformation, gaining confidence and autonomy enough to withstand a cruel and indifferent world.

“The Way, Way Back” trafficks in a generous share of too-obvious plot pivots and its depictions of the adults — checked-out and selfish in Trent’s world; authentic, sincere and lovably quirky in Owen’s — seem glib and too convenient. But there’s much to value in a film that takes such observant care with atmospheric details, from the film’s fabulous soundtrack (extra points for a vintage Robert Palmer track) to the real-life Water Wizz, a gloriously aquamarine monument to American vernacular kitsch. “The Way, Way Back” also features one of the best endings in recent movie memory — and as we all know, endings are the hardest. If it takes some predictable twists and turns to get there, well then, accept it and move on.


PG-13. At Landmark’s E Street Cinema, Landmark’s Bethesda Row Cinema and Angelika Film Center. Contains thematic elements, profanity, some sexual content and brief drug material. 103 minutes.