Grade: B+

American comedies dealing with characters from the lower end of the socio-economic spectrum are rarely successful; most wind up as condescending and insipid as “Waking Up in Reno,” a trailer-trash extravaganza with a starry cast (Billy Bob Thornton, Charlize Theron, Patrick Swayze, Natasha Richardson) poised for release last spring but so savagely received in press screenings that Miramax wisely scratched it from the schedule (it’s now listed as a fall release, but may never see the inside of a multiplex). That’s one reason why Miguel Arteta’s “The Good Girl” is such a pleasant surprise. A shrewd, observant ensemble comedy-drama, it’s packed with hayseed types and depicts them sharply and amusingly, but at the same time it maintains an underlying empathy for their plight, making you care about what happens to them. The intermingling of light and shade is characteristic of Arteta and writer Mike White, who also collaborated on “Chuck & Buck” (2000); while this film is far less dark and disturbing, it too will both make you laugh and give you pause.

White’s scenario centers on an interlinked group of people in a small Texas town; each is unhappy in his own way and searching for escape, some through so simple a means as drugs, others in religion, many by fantasizing about alternate futures for themselves. The linchpin among them is Justine (Jennifer Aniston), the unfulfilled wife of Phil (John C. Reilly), who works as a housepainter in tandem with his buddy Bubba (Tim Blake Nelson). Justine and Phil have been trying unsuccessfully to have a child, and Justine has a dismal job at the Retail Rodeo, a poor cousin to K-Mart. Her fellow workers include Cheryl (Zooey Deschanel), a disaffected youngster who peppers her announcements over the store speakers with deadpan insults and has a field day overdoing things when offering free cosmetic makeovers; Corny (White), a security guard with a blank smile who’s a Jesus freak; Gwen (Deborah Rush), a spinster who considers Justine a closer friend than Justine thinks her; and clueless store manager Jack Field (John Carroll Lynch), who compensates for anything and everything by overeating. Into this odd mix comes gawky, preternaturally shy clerk Tom Worther (Jake Gyllenhaal), who calls himself Holden after the character in his favorite novel, “The Catcher in the Rye,” and dreams of becoming a writer himself. Weary of Phil and Bubba’s boozing and pot smoking, and clearly stifled by her dead-end life, Justine is strangely drawn to Holden, who seems a poetic, romantic alternative despite (or perhaps because of) his brooding, potentially self-destructive personality; and before long the two are sharing not only lunch but an occasional motel room. The ramifications, which eventually draw in all the other characters as well, are both very funny and strangely poignant.

White’s script is a clever, well-constructed piece of work, but it could easily have gone awry in the wrong hands. Happily Arteta–as “Chuck and Buck” clearly demonstrated–is well attuned to the odd rhythms of the writing and generally sensitive to its delicate balance between the comic and the serious. Though the picture sometimes looks ragged around the edges (one function of its modest budget), his touch is mostly well-gauged, and he secures wonderful performances all around. Aniston is quite simply a revelation; sporting a pitch-perfect accent and shedding every trace of her sitcom persona, she captures both Justine’s dowdy look and the character’s intermingled frustration, longing and terrible insecurity. The others offer impeccable support. It’s always a joy to encounter Reilly, who turns Phil, who might have been a caricature, into a subtle, multi-faceted fellow, and Gyllenhaal continues his string of exceptional turns (“Bubble Boy” always excepted) as the anxious, pathetic Holden–surely he’s one of the best young actors working today. Nelson, White, Rush and Lynch haven’t quite as many opportunities to impress, but they seize every one they’ve been given; and Deschanel proves an accomplished scene-stealer, though the hilarious lines White has provided for Cheryl have a lot to do with it. Daniel Bradford’s production design and Enrique Chediak’s straightforward cinematography get the look of things right: this is a dusty, dreary town, as far from the plastic glamor of “Friends” as Aniston’s Justine is.

“The Good Girl” isn’t perfect–a few of the twists seem a bit precious and occasionally things are played a trifle too broadly. It does, however, exhibit a welcome–and unfortunately all too rare–willingness to showcase characters on the economic edge who, while amusing, are deeply flawed but still sympathetic, and to depict their actions as morally ambiguous to the very end. A little film that cannily melds edgy satire with a degree of warmth and even a touch of profundity, “The Good Girl” has some minor problems, but overall it’s a treat; and for Aniston it could well represent a career breakthrough.