Though Sam Elliott’s long career has included the occasional starring role—as in Daniel Petrie’s “Lifeguard” (1976)—he’s best known for memorable supporting turns and his mellifluous deep voice, a circumstance that’s continued into his seventh decade, when he’s become the go-to guy to play the sexy romantic interest for female stars of a certain age, whether it be Lily Tomlin in “Grandma” or Blythe Danner in “I’ll See You in My Dreams.” Brett Haley, who directed Elliott in the latter, now brings him to center stage in “The Hero,” and while it’s nice to see him there, one must note that the movie itself is not exactly an inspired effort. Still, his presence alone makes it worth the price of admission.

Elliott’s Lee Hayden is a onetime western star reduced to recording taglines for barbecue commercials, long estranged from his ex-wife Valarie (Katharine Ross), an artist, and daughter Lucy (Krysten Ritter), both of whom blame him for ignoring them when his career was in full swing. His only friends, it seems, are the agent he periodically calls to see if there are any job offers (all that’s on the table at the moment is a lifetime achievement award at a dinner sponsored by an outfit called the Western Appreciation and Preservation Guild) and his drug supplier Jeremy (Nick Offerman), an erstwhile actor he once worked with on a short-lived TV series. As if his luck weren’t at sufficiently low ebb, his doctor informs him that a biopsy reveals that he’s suffering from pancreatic cancer.

That news sends him on a journey to rehabilitate his connection with Lucy, but also to a new relationship—with Charlotte (Laura Prepon), a stand-up comedian half his age who’s also one of Jeremy’s customers. They meet cute at the supplier’s house and then bump into one another again at a food stand. Lee impulsively asks her to accompany him to the awards dinner, and after they share some pharmaceuticals along the way, he turns his acceptance speech into an event that quickly goes viral online and gets him both media attention and an invitation to audition for a role in a major movie.

Of course, Lee’s prognosis remains in serious doubt. Much of “The Hero”—also the title of the only film he made that he’s still proud of—consists of Elliott ruminating on his situation, staring out on the waves crashing onto the coast outside his beachfront house or having dreams in which he’s an old cowpoke being hunted down by bounty hunters—intimations of the mortality he can’t escape, you see. Can he sustain his relationship with Charlotte, even after he watches her deliver a monologue that appears to be drawn from their time together? Can he ace that career-restoring audition, despite his failing memory? Can he get Lucy to give him a second chance after he’s stood her up yet again?

The script by Haley and Marc Basch doesn’t do much you haven’t seen before, as recently as in Robert De Niro’s “The Comedian,” which lacked the impending death motif but otherwise followed a very similar trajectory. But while De Niro, though perhaps the better actor, went for broke and delivered a performance so frenzied that it bordered on the manic, Elliott is restrained, even in the sequences at the awards dinner and the audition, where he hits the right notes without going to extremes as other actors might have done. It’s not as if he simply declines to show emotion: the look he gives Lucy outside a tennis court speaks volumes, and the flash of anger he shows toward a photographer after his audition is fierce. For the most part, however, Elliott plays things close to the vest, preferring suggestion to ostentation.

The others in the cast, quite frankly, simply circle around him. Prepon brings a charge of energy to Charlotte, even if—as so often occurs in such cases—her stand-up scene is no stunner, and Offerman is nicely laid-back as Jeremy. Nobody else—including Ross and Ritter—makes much of an impression, though it’s always nice to encounter veteran Max Gail, who plays the fellow in charge of the awards ceremony, and Patrika Darbo is effectively nervous as the audience member Lee singles out for recognition there.

The behind-the-camera contributions are about what you’d expect in an indie. Haley’s direction, like the script, is basically of yeoman quality, and his editing could be sharper, though one can understand his desire to linger on Elliott’s craggy face as long as possible. Rob C. Givens’ camerawork is fine, even if he sometimes strains for poetic effect, as the screenplay does when it brings Edna St. Vincent Millay into the dialogue.

Ultimately, though, the film rests squarely on Elliott’s trademark moustache and deep baritone. “The Hero” might be little more than a familiar tale of a man looking back regretfully at past mistakes and trying to redeem himself in his twilight hours, but he makes it watchable—if only just.