DANCING AT THE RASCAL FAIR By Ivan Doig Atheneum. 403 pp. $18.95

IVAN DOIG is a happy mixture of poet and historian. In just nine years he has produced five truly distinctive books set in Montana and the Pacific Northwest, three of them novels. All beautifully evoke the American westering experience and firmly establish Doig as one of our finest Western writers.

Look at his achievement: This House of Sky: Landscapes of a Western Mind, published in 1978 when he was 39, is a powerful memoir about his widowed, sheep-herding father, Charles Doig, son of Scottish immigrants, who instills in his son a deep affinity for language, storytelling and the raw Montana landscape.

This strong sense of the land and a growing preoccupation with time are further developed in Winter Brothers (1980), interwoven observations by Doig and excerpts from the 1862-90 diaries of James G. Swan, an obscure artist and observer of coastal Indian life in the Pacific Northwest.

The imaginary retrieval of the past became central in The Sea Runners (1982), his first novel. Based on an actual event, it tells of the escape by four indentured Swedes from Russian America (1853 Alaska) to what is now Oregon in a stolen canoe; two die on the way. It is a little masterpiece of harrowing adventure.

In English Creek (1984), the first novel in a projected trilogy, Doig introduces the fictional McCaskill family and their sprawling Two Medicine Country. This is the familiar geography of This House of Sky, though the town of Dupuyer, just below the Rocky Mountain Front, has now become Gros Ventre (the locals say "Grove-on"). It is summer in the 1930s and Jick McCaskill, the 14-year-old narrator, goes on a horseback trip with his forest ranger father, Varick. Some of the set pieces in this coming-of-age story, such as a Fourth of July rodeo and a forest fire, are terrific.

Dancing at the Rascal Fair is the trilogy's second volume. Another panorama of life in Two Medicine Country, it takes place much earlier, 1889-1919, and its dramatic thread is the friendship and eventual falling out of two Scotsmen, Rob Barclay and Angus McCaskill, Jick's grandfather. They venture from Glasgow by steerage, fellow villagers of Nethermuir, and homestead as neighbors in Montana, doing what they know, sheep-farming. At work out on the range, in the lambing shed and docking corral, over 30 years they prosper, Angus teaches in a one-room school and, thwarted in his love for Anna Ramsay, another teacher, he marries Rob's sister, Adair.

Time passes through them as they go from youth to middle age, and blizzards, the 1918 influenza epidemic and the raw, rugged land take their toll. The building of fences to divide the once-open rangeland into national forest spells the passing of these pioneer days.

The book is warm in feeling and rich in texture; I found it packed more emotional punch once Varick, the McCaskills' only child, enters the story; there are strong overtones of Doig's own relationship with his father. Indeed, Charles Doig is quoted at the outset: "Scotchmen and coyotes was the only ones that could live in the Basin, and pretty damn soon the coyotes starved out." An attraction of Doig's books is how they all fit together; they expand our experience.

DOIG DOES better to convey the quiet feel and detail of ordinary life than to crash cymbals in dramatic cresendo. As Chekhov said, the best writers are realistic and describe life as it is. Doig has said that he tries to "make the stuff up as realistically as I can." But to describe past life as it was is to lack the stimulus of immediate experience. How does he breathe so much life into it?

The secret of Ivan Doig's gift, I think, is his sense of surfaces and place and his ear for dialogue; his people come alive when they talk. And they talk all the time. All but one of his books is written in the first person.

In the earliest, 1889, passages of Dancing at the Rascal Fair, his two Scots speak English strongly influenced by Biblical and Shakespearean cadences. By 1919, they sound a lot more like their fellow American sheep-herders and ranchers. Doig can enter the talk of Burns-quoting Scottish immigrants or grim Scandanavian escapees of a century ago. Or the talk of modern cowboys at a rodeo. He changes his voice as he becomes for the time being one of them.

Here is Angus McCaskill, noting infant lambs are "a majority of legs, long and askew as the drone pipes of a limp bagpipe." The same narrator voices Doig's creed of realism: "It would be heartening to think the world is growing less harsh, but the evidence doesn't often say so."

Nor is Doig's gift merely literary. Besides his intuitions and artistry there is the iron of purpose of an ex-ranch hand who has earned his PhD in history. An enormous researcher, Doig is one of those historians who goes from library to library forever on the scent of new documentation. He pours over faded records and newspapers, he reads, he hikes, he travels, he explores, and he talks to all the old people he can. Unusual among novelists, he provides an acknowledgments section at the back of each book, telling how he put it together and who helped him.

In Montana and the Pacific Northwest, this gifted poet-historian has enormous, vivid experience to draw upon as he sets out to rescue some more of our past from oblivion. Let us cheer him on, hoping the next nine years will be as productive as the last.

Richard Critchfield is the author of "Those Days: An American Album" and "Villages." He is currently writing a book about Britain.