Consider “Death Wish.” In the original film, Charles Bronson sought revenge against the thugs who raped his daughter and killed his wife — heinous acts that the audience enthusiastically agrees ought to be punished, even if it requires vigilantism.

Now consider “Red,” also about a man seeking justice, only this time the murder victim is his beloved old dog, killed with a shotgun by juvenile delinquents. We agree that the act is monstrous, but what kind of punishment is appropriate? Even the most fervent dog-lovers don’t generally believe in the death penalty for killers of canines.

That’s the dilemma at the heart of “Red,” an emotionally gripping if slightly over-wrought drama based on a novel by Jack Ketchum. It’s set in a small Western town that still has a general store and friendly neighbors, a place where just about everyone has a dog. (The only pet-free families, I note, are the bad guys.) Brian Cox plays Avery Ludlow, a widower whose boon companion is Red, his 14-year-old hound. The two are fishing on the lakeshore one afternoon when a trio of punks comes along to harass and rob him. The leader, Danny (Noel Fisher), ends the encounter by blasting Red with a shotgun.

Av is devastated. His first thought is not to call the police but to simply talk to the boys’ parents. Unfortunately, Danny and his brother Harold (Kyle Gallner) are the offspring of Michael McCormack (Tom Sizemore), a wealthy businessman who eagerly swallows his sons’ lies about their whereabouts on the day in question. The third boy, Pete (Shiloh Fernandez), is poor white trash whose parents want to stay in the McCormacks’ good graces.

In “Death Wish,” there were legal technicalities that prevented the evil-doers from being prosecuted. Here, the problem is simply that what the boys did is nothing more than a misdemeanor, and it’s Av’s word against theirs anyway. It’s not the legal system that has failed Av. It’s the law itself, which holds that animals are simply “property” and that killing one is only barely a crime at all.

A TV newswoman named Carrie (Kim Dickens) does a piece on Av’s plight in the hopes of shaming the district attorney into doing something. The consequence of her report — consequences are a major theme in this story — is that the McCormacks are riled up even further. The battle between Av and Danny escalates, with Av always careful not to break the law while trying to goad Danny into it. It helps that Danny is an easily provoked hothead, while Av is calm and patient. Harold is reluctant and always on the verge of confessing; Pete, the third boy, is virtually ignored by the story. (His parents, seen only in the doorway of their dingy home, are played by Robert Englund and Amanda Plummer and get more screen time than he does.)

The director was Lucky McKee (whose “May” was a darkly comic horror gem a few years back), but he was replaced halfway through by Trygve Allister Diesen. As is often the case with these things, the finale feels a bit tacked on, and the subplot with Carrie the journalist never really gels. The brief moments of Av grappling with the moral implications of his actions are underdone, too.

But Cox’s performance is more than enough to make the film worthwhile. With his gravely folksy demeanor, he has the decency and wisdom of a small-town judge. He lends respectability to a film that is, at its heart, pretty basic and even manipulative. When someone tells Av that he’s crazy, and Av responds, “In that case, you’d better do as I tell you, hadn’t you?” — OK, it’s not the best thing I’ve ever heard, but Cox really sells it. Don’t mess with a man and his dog, folks.

B- (1 hr., 38 min.; R, some harsh profanity and violence.)