“Three Billboards Outside of Ebbing, Missouri,” a tragicomic juggling act packed with vivid characters doing bad things at considerable moral cost, plays like a scalpel-sharp game of Catch the Sociopath.

It begins with a heroine, sort of. After seven months of unproductive investigation into the killing of her teenage daughter, single mother Mildred Hayes brings the issue to the court of public opinion. She rents a trio of abandoned outdoor signs to convey her anger in a way the authorities can’t ignore:

RAPED WHILE DYING

AND STILL NO ARRESTS?

HOW COME, CHIEF WILLOUGHBY?

Mildred reveals her publicity campaign on Easter Sunday, spoiling the Willoughby family’s holiday dinner. With a contract to keep the signboards in place for a year, they get the attention Mildred expected and then some. She draws statewide attention from a TV news crew, and triggers a twisted municipal battle of wills. Wanting to retaliate against someone — anybody — Mildred’s pursuit of revenge turns the town into a war zone that’s both brutal and awkwardly funny.

Creating laughs to die for is a craft that writer/director Martin McDonagh is quite good at. After the sophisticated gangland sagas “In Bruges” (magnificent) and “Seven Psychopaths” (a lesser film, but still first-class), he has given us a spirited, cunningly clever masterpiece.

That seems to come partly by borrowing from the best. While McDonagh’s work here never feels hand-me-down, its focus on small-town crime sprees, self-destructive stratagems and character-rich humor clearly benefits from groundbreaking work by the Coen brothers. The individuals are clueless and anarchic in ways that seem odd yet feel recognizably human. The small-town locations (handsomely photographed by “Guardians of the Galaxy” cinematographer Ben Davis) positively ooze heartland authenticity.

The best-laid plans of everyone backfire like blazing boomerangs. This is the sort of film that makes you chuckle when a player throws a Molotov cocktail about as well as Wile E. Coyote, and gasp in shock as it sets off an explicitly violent inferno.

After her career-capping turn as kindly Minnesota cop Marge Gunderson in “Fargo,” Frances McDormand gives a bigger, better, more gripping performance here as her opposite number. Her Mildred is tough as nails after about 60 years of hard life. But she conceals a streak of compassion that a woman low on society’s food chain might hide so that it’s not taken as vulnerability. She bites when she needs to but mostly uses a frightening, sarcastic bark.

It’s not until we’re well into the film that McDonagh introduces flashback scenes of her bickering, battering relationship with her abusive ex-cop ex-husband (John Hawkes, excellent as always). Without having the point hammered home, we begin to understand why their daughter was spending lots of time away from their supervision, and why Mildred may be using her quest to deal with a sense of guilt she would never express. She’s as much a vigilante as a hero.

As the police chief, Woody Harrelson is a decent, good-humored, reasonable man, leading a crew not overstocked in the brains department. He offers Mildred legitimate reasons why they haven’t been able to crack the tough case: no witnesses, no physical clues, no DNA match from the scene to anyone on file.

He doesn’t think turning the mystery into a permanent scandal will help Mildred, whose local popularity is at the bottom of the barrel. He lets her know that it’s not likely to inspire him to pursue evidence day and night, informing her that he’s dying of pancreatic cancer. He’s surprised that Mildred, like everyone else in town, is aware of that secret.

“And you still put up those billboards?” he asks. “Well,” scoffs Mildred, “they wouldn’t be as effective after you croak.”

This richly layered story never curdles into film noir cynicism. The secret sauce that McDonagh adds to the story’s bloody goulash is a sense that kindness and cruelty may coexist in most of us, and that the good has a 50-50 chance of winning.

One of the best supporting roles of the year goes to Sam Rockwell as Officer Dixon. He begins as an incorrigible dimwit bigot who swings his nightstick without provocation. When we see him living with his even more racist mom (“It’s Always Sunny In Philadelphia’s” incomparable Sandy Martin), we begin to understand that this very bad good ol’ boy has his own reasons for drinking too much and hanging out at the pool hall all night.

McDonagh has created a rare, nuanced revenge story that’s more than a spiraling cycle of violence. It’s gut-bustlingly funny and conscious that while life isn’t generally fair, it can be forgiving.