By Robert B. Parker

Putnam. 276 pp. $24.95

In the mid-20th century, the western was dominant in American popular culture. Young buckaroos spent their Saturday afternoons whooping and hollering at Roy Rogers and Gene Autry shoot-'em-ups. John Wayne, having won the war, was back to winning the West. Television was launching popular series such as "Bonanza" and "Have Gun, Will Travel." It was widely reported during the Eisenhower years that the president's favorite bedside reading was western novels by Zane Grey and Louis L'Amour, and when the young Elmore Leonard set out to be a writer, that was the genre he naturally chose. Then, in the 1960s and '70s, the world changed. Ours was an increasingly urban nation, in fact and myth. Eisenhower's successor, John F. Kennedy, read Ian Fleming's spy novels, not Grey's westerns. After Vietnam, six-gun heroics didn't resonate so well. As the western market dried up, Leonard switched to crime novels. The private eye supplanted the lone cowboy in our mythology. Today, the great western themes echo only rarely -- in Larry McMurtry's novels, an occasional movie such as Clint Eastwood's "Unforgiven," or a TV show like HBO's "Deadwood." The cultural caravan has moved on.

So why has Robert B. Parker, the hugely successful author of more than 30 Spenser novels, written a western? He clearly didn't write it to compete with dark, violent revisionist works like "Unforgiven" or "Deadwood." Nor is "Appaloosa" an ambitious epic on the scale of McMurtry's "Lonesome Dove." Rather, Parker seems to have written "Appaloosa" as an exercise in pure, old-fashioned storytelling, and on those terms it succeeds quite well. Parker takes material we have all known for years -- gunslingers, saloons, shady ladies, shootouts, Indian raids -- and brings it to life with writing that is fresh, fast and sure. "Appaloosa" is by no means profound, nor is it meant to be. But it is the work of a master craftsman, and reading it is exciting and fun.

Parker is vague about time and place. The time could be the 1880s, and the town of Appaloosa exists somewhere north of Texas and between St. Louis and Denver. A railroad runs nearby, and hostile Indians still roam the plains. Call it the mythic West. In an opening scene on the streets of Appaloosa, three drunken cowboys shoot a man and rape his wife. The next day, the town marshal and two deputies ride out to a ranch owned by a man named Randall Bragg to arrest the three. Instead, the marshal and a deputy are shot dead; the other deputy escapes.

Enter our heroes. Virgil Cole is a legendary gunman: "He fought with an odd stateliness. Always steady and never fast, but always faster than the man he was fighting." Cole is a professional lawman, a man of few words who moves from town to town: Silver City, Nogales, Bisbee, Durango. He has killed many men but always with the law on his side. His partner and deputy for 15 years is Everett Hitch, a West Point graduate who fought in the Indian Wars but found Army life "sort of crampsome," so he quit and joined up with Cole. Hitch, an articulate man, narrates the story. The partners are recruited by the town fathers of Appaloosa to save their community from Bragg and his gunmen. Here's part of their job interview:

"I heard after you and Hitch came in and sat on Gin Springs one summer, babies could play in the streets."

"That's why we sent for you," Raines said. "We're ready to pay your price."

Cole looked at me.

"You game?" he said.

I shrugged.

"It's what we do," I said.

A smile like the flash of a spark spread across Cole's face.

"It is," he said, "ain't it."

Events unfold with a certain inevitability. Bragg, the corrupt rancher, hires two legendary gunmen, the Shelton brothers, to kill the two lawmen. Cole has known Ring and Mackie Shelton for years and respects their killing skills. They are, he says, almost as good as he is and probably better than Hitch. He introduces Hitch to them, and the scene ends like this:

"Nice meetin' you boys," I said.

"Likewise," Ring said.

Mackie nodded. None of us offered to shake hands. There was no advantage to letting somebody get hold of you.

The showdown between the two lawmen and the Sheltons is postponed when Indians attack all of them on the plains and they must declare a truce to survive. Further complicating matters, Cole falls in love. Allie plays the piano, badly, in the town's best saloon. She will soon cause Cole, whose previous romantic experience has been limited, more grief than the Indians and the gunmen put together. Allie gravitates to the top gun, whoever he may be.

Parker captures the West as neatly as he does the streets of Boston: "The sun was high and steady. I could smell the river and the grass. The horse was frisky from standing around in the woods. He capered a couple of times as we moved into the sun. I held him to a walk. There was no reason to hurry. Nothing was moving but me."

The novel takes an unexpected twist near the end. Cole and Hitch have always counted on their badges to protect them. "I never took the legal stuff too serious," Hitch admits. "It was just a way to feel easier about being a gun man." But they face an unexpected challenge -- a moral dilemma, even -- when their enemy, Bragg, wins powerful political support. What can a couple of itinerant lawmen do when the criminals they're sworn to vanquish become the powers that be? Still, things work out. In the mythic West, there weren't many problems that a six-gun couldn't solve.