"I wish there was a story about me," muses Jennifer Aniston's Justine, the downtrodden heroine of The Good Girl. "But I don't know who'd read it," she adds. Before the movie is over, a story does get written about her, but since it appears to be unpublishable, we'll have to settle for the movie version, a garishly funny and humane comedy from the team of Miguel Arteta and Mike White.

Justine is a timorous, 30-year-old clerk at a shabby Texas discount store called Retail Rodeo. Married to a pothead housepainter (John C. Reilly) whose drug habit has robbed him of the power to procreate, Justine's life is going nowhere, and she knows it. Desperate for an escape, she's willing to grab any lifeline.

Fate throws her a rope in the form of Tom Worther, a new cashier who is a decade younger than Justine and still lives with his parents. He's pretty cute, if a bit self-involved, and he makes an initially attractive show of melodramatic alienation. Tom introduces himself to Justine as "Holden," after the hero of the book he's reading, The Catcher in the Rye. Justine is impressed by Holden's brooding intensity, and she confides that she, like he, wants something more than life in a Texas Retail Rodeo. Unfortunately, Justine obviously hasn't read the Salinger novel. Otherwise, she'd know to steer clear of anyone over the age of sixteen who keeps re-reading that book. (One such devotee was John Lennon's murderer, Mark David Chapman.)

Nevertheless, the two are soon having nightly trysts in a cheap motel and, occasionally, daytime ones in the stock room of the Retail Rodeo. Initially, the sex is good for Justine, jolting her out of her rut, and forcing her to take stock of her dead-end life and her well-meaning, but ineffectual and impotent husband. Holden, on the other hand, begins to reveal a dangerous neediness.

Holden is played by Jake Gyllenhaal, who has pretty eyes, an ironic smirk and a slow, deliberate rhythm. Gyllenhaal specializes in playing bright and soulful young men and he's a fairly hot property right now (he's starring opposite Dustin Hoffman in Moonlight Mile, due out this fall). He came to wide notice last year as the haunted title character in the excellent Donnie Darko, and he currently plays Catherine Keener's teenage boy-toy in Lovely & Amazing. As the hysterical and self-pitying Tom "Holden" Worther, Gyllenhaal offers a send-up of his past roles, and he manages to be both alluring and utterly ridiculous. (Barring an unlikely coincidence, the name "Worther" is a nod to Goethe's 18th-century sensation, a novel called The Sorrows of Young Werther. Centuries before Judas Priest, Nine Inch Nails and Marilyn Manson allegedly began driving kids to self-slaughter, Goethe's book was blamed for a rash of teenage suicides across the Continent.)

In large measure, The Good Girl is a fictional visit to the milieu mapped out in Barbara Ehrenreich's bestseller, Nickel and Dimed, which was the author's account of trying to survive in the low-wage service industry (a project that included a stint as a Wal-Mart associate). In The Good Girl, Justine's Retail Rodeo is every bit as deadening as Wal-Mart: the same society of exhausted, ill-kempt customers loading up on cheaply produced goods and trundling them through checkout lines that are staffed by equally exhausted and demoralized cashiers. But because the script is by Mike White, The Good Girl resists sentimentalizing or ennobling its service industry victims. Indeed, to our occasional discomfort, White is perfectly happy to score some laughs at the expense of the yokel characters, in the fashion of the Coen brothers, only more coarsely. At one point, the film's most odious idiot leers at Justine and says, "If I wuz a woman, I'd be a sluuuhhht. A lezzbian sluhht."

But where White and the Coens part company is that White is genuinely interested in how working stiffs get through their days, whereas the Coens evince little empathy for their characters, preferring to yuk it up as they simultaneously pursue a rather academic agenda (this worrisome trend recently hit its apex with the all-too-well-titled The Man Who Wasn't There). The cartoonish yahoos in Coen films seem to live under rocks, until it's their turn to bray in front of the cameras. In contrast, White shows the wage slaves in The Good Girl keeping their spirits alive with drugs, religion, new ageism, television, defiance of authority and, in the case of Justine and Holden, extramarital sex.

White has a short, but promising track record of balancing baleful social satire with redemptive humanity and optimism. He established his reputation by writing and starring in the ultra-low-budget Chuck and Buck, a marvelous film that could be subtitled "A Portrait of an Artist as an Eternal Eleven-year old." This film (which, like The Good Girl, was directed by Miguel Arteta) tells the tale of an infantile homosexual's obsession with a handsome hetero who'd been a childhood buddy. White's script draws us deeply into this relationship, even as he relentlessly redlines the queasiness and humiliations until we think we can't watch any more. Then, miracles begin to happen.

White's script for The Good Girl is a little more familiar, broadly following the templates of other movies about outlaw lovers. Still, he pulls off small surprises, and even the easiest caricatures in the film earn flashes of sympathy. White himself appears as the Retail Rodeo's security guard, a born-again Christian who's always recruiting people to come to his weekly Bible study group. Initially, the character comes off as a noxious creep, one of those fervent Bible-beaters who has unspeakable secrets locked up in his basement. Although the character never becomes anyone's pal, White gives the role enough shading so that we recognize him as an earnest, if not terribly bright, working stiff.

There is a limit to our suspension of disbelief when it comes to casting a well-groomed star like Jennifer Aniston in the lead. Although Aniston does a credible job of turning herself into a meek, slouching working-class victim, she still looks like that actress from Friends who gets into bed with Brad Pitt every night. It's a tough call: A homelier and less famous performer might be more convincing in this role, but a star like Aniston helps the movie find an audience. Aniston can't shake her People magazine aura, but her self-consciously self-effacing performance is effective, and Justine's desperation is palpable. "Are you going to the grave, with unlived lives in your veins?" she asks herself as she contemplates an affair with Holden.

The film's title is both earnest and ironic, for Justine strays from the path of righteousness in her affair with Holden. But we understand that she's trapped, and we can hardly blame her for trying to brighten her existence. Justine is never comfortable in the role of adultress, and the relationship quickly becomes painful and complicated. Her passivity is frustrating, anti-heroic and utterly believable --at one point she even succumbs meekly to another character's sexual blackmail. Stuck in miserable circumstances, without the benefit of education or social advantage, Justine nevertheless remains in dogged pursuit of a happy and moral life. By the film's end, when a character compliments her patronizingly by saying, "You're a good girl," the now miraculously pregnant Justine has acquired the grace of the original Madonna.