Of course Sam Elliott knows there’s comedic gold to be mined from his famous rich and deep voice, and his gloriously deadpan delivery.

Elliott was “The Stranger” in “The Big Lebowski,” for crying out loud. And did you catch his hilarious arc as the hippie-vegan peacenik on “Parks and Recreation”?

Even when we’ve just heard Elliott’s unmistakable pipes on commercials for Dodge, IBM, Union Pacific, the American Beef Council, et al., we can practically picture the twinkle in the veteran actor’s eye as he recites the lines.

Director and co-writer Brett Haley’s low-key charmer “The Hero” is a self-referential fictional film in which a beloved veteran actor plays a variation on himself. (See, Keaton, Michael, in “Birdman.”)

Elliott plays Lee Hayden, a faded former star of Western movies and TV shows from back in the day. (NPR’s Mark Jenkins noted the name of Elliott’s character is a combo platter of Lee Marvin and Sterling Hayden.)

The first time we set eyes on Lee, he’s recording a spot for barbecue sauce — just the sort of gig the real Sam Elliott would take to pay the bills and keep busy.

Lee is content to glide through his life’s final act, spending his days getting high with his pot dealer and one-time TV co-star Jeremy (Nick Offerman, whose Ron Swanson tangled with Elliott’s character on “Parks and Rec”). Sure, he’ll ask his agent if anything more substantial than another voice-over gig has crossed the transom, but he already knows the answer before his agent says they’re expecting something really big any time soon.

But then Lee gets some bad news, medically speaking. He keeps that news to himself, but it propels him to engage with his ex-wife (Katharine Ross, Elliott’s real-life spouse) and his estranged daughter (Krysten Ritter), to earnestly pursue one last great role and even to indulge in a romance with a much, much younger woman named Charlotte (Laura Prepon).

When Charlotte asks Lee how old he is, Lee responds:

“Seventy. [Pause]. One.”

As if the “one” might be the factor to send her out the door.

It’s a sublime comedic moment, with perfect timing. What a treat it is to see Sam Elliott in a lead role at this stage of his career, and having so much fun with it.

Thanks in large part to Elliott (and Offerman and Prepon and Ritter, among others), “The Hero” survives some bumpy, well-worn clichés. Just once I’d like to see a movie where a divorced dad drops in on his grown daughter, and she DOESN’T say things like, “What are you doing here?” and, “That was my job TEN YEARS AGO, Dad.”

Also, if you’re a screenwriter and you’re considering a pivotal plot about a raw and seemingly embarrassing moment that is caught on amateur video and then goes “viral, in a big way!,” please reconsider.

Director Haley comes up with some effective stylistic touches, meshing developments in Lee’s real life with snippets from his one iconic movie, titled “The Hero.” The relationship between Lee and Charlotte is similarly creative, with some nifty turns and touches.

But of course the main selling point is Sam Elliott aka Lee Hayden. I don’t even know who makes that barbecue sauce Lee is touting at the beginning of the film or whether it’s really good or just mass-produced glop, but based on that voiceover, I’d buy it in a heartbeat.

★★★

The Orchard presents a film written and directed by Brett Haley. Rated R (for drug use, language and some sexual content). Running time: 96 minutes. Opens Friday at local theaters.