"THE BLUE and the Gray" simultaneously recreates the struggle between the North and the South and epitomizes the perennial battle between the sublime and the ridiculous, at least in the production of television dramas based on fact. The eight-hour CBS miniseries about the American Civil War achieves formidable cumulative power, yet repeatedly indulges in digressions that play havoc with credulity and threaten to reduce the entire project to pulp.

At times, the miniseries, which begins tonight, falls back on the kind of dramatic conventions one would expect from something produced during the Civil War, and at its worst, it begins to seem like just one terribly long episode of a single banal TV series. On the other hand, this is the most substantial dramatic treatment of the Civil War ever undertaken for television. And for every dopey scene involving a trumped-up romance or burble of hokum, there is a scene of gripping or moving intensity. Overall, the miniseries doesn't gussie up the Civil War, nor relegate it to the position of backdrop for romantic potboiling. It is not the John Jakes roll-in-the-hay approach to American history, though sometimes it comes uncomfortably close.

Something approaching epic sweep is achieved, even though some major characters are cartoons, and when it's all over, one is likely to feel much closer to this incomparably pivotal era of American history than one did before. There aren't many TV projects that have honorable intentions or such commendable results .

CBS will show "The Blue and the Gray" on Channel 9 in three installments: three hours tonight at 8, two hours Tuesday at 9 p.m. and a three-hour conclusion Wednesday at 8 p.m.. (Monday night is a truce, in honor of not wishing to pre-empt "M*A*S*H.")

The idea behind the film -- based on a story cowritten by the late Bruce Catton, a Pulitzer Prize-winning Civil War historian -- is to show the effect of the war on ordinary citizens, not to concentrate on well-known figures. Nevertheless, Ulysses S. Grant, Robert E. Lee and Abraham Lincoln are portrayed -- Lincoln by Gregory Peck, playing his first TV movie role under a heap o' makeup and strikingly impressive for the matter-of-fact way he interprets the part. Peck's Lincoln is utterly cantless and without a single grandiose strut.

Near the beginning of part three, Peck recites the Gettysburg Address in just under three minutes. He doesn't huff, he doesn't puff; he is true to the poetic clarity and purity of the speech. It's understated and yet quite beautiful.

The producers chose to rest the continuity of their huge miniseries on surprisingly frail shoulders, however. Most of the story, which covers the years 1859-1865, is seen through the eyes of a fictional young man, John Geyser, who was born near Charlottesville but vows never to fight for the Confederacy after vigilante racists hang a free black man accused of sheltering runaway slaves.

The lad travels north and becomes an illustrator-correspondent, the 19th-century equivalent of a news photographer, for Harper's Weekly. This enables him to play I-am-a-camera for the film and function as the closest thing to a neutral surrogate for the viewer. He even manages to get his own private meeting with President Lincoln, believe it or not (and you won't.)

Geyser is played by John Hammond, an outrageously ingenuous young actor who was particularly fine in "A Few Days in Weasel Creek," an unpretentious picaresque adventure that CBS aired quietly last year. Hammond's problem is that the character he's playing is passive and almost passionless; he stands around and sees things happen, reacting little. But there's something just compelling enough about Hammond to make one care about him and trust he will survive the horrors he observes, as well as certain dramaturgical horrors the script writer has up his sleeve.

Of these, none is quite so pointless and intrusive as a duel involving Geyser and a German soldier who had been romancing a senator's daughter (the bewitching Kathleen Beller) on whom Geyser is sweet. The scene is preposterous, and the German a cheap, witless stereotype (the kind TV would not allow if the character were of some more fashionable nationality). Don't those Hollywood writers know that it's Germans who make their precious Mercedes Benzes?

The most solid continuum throughout all eight hours is Stacy Keach as Jonas Steele, a shadowy figure who, like Geyser, manages to turn up at an awful lot of crucial events. It helps that Keach, who plays a sort of free-lance troubleshooter, looks so much like someone from the era, as if he were lifted off an old photograph. Others who turn up, briefly, along the way include Paul Winfield as Jonathan, the young man who was lynched; Sterling Hayden as the defiant John Brown (Geyser's first assignment just happens to be Brown's trial); Rory Calhoun as Gen. George Meade; Rip Torn as Grant; Geraldine Page as a batty old lady in Vicksburg, Miss.; Diane Baker as Evelyn Hale; Robert Vaughn as a supercilious senator (the one with the daughter); the always excessive Colleen Dewhurst as Geyser's mother (she's turning into an intolerable combination of Patricia Neal and Katharine Hepburn) and Robin Gammell as Geyser's Uncle Jacob, who gets to say, early in the film, "I don't want to hear any more about war. It won't happen. There's too many wise heads in Washington." Did anybody ever think there were too many wise heads in Washington?

Also noteworthy are the young actors who communicate the boyishness of those who fought and died in the Civil War, particularly two of Geyser's brothers, Cooper Huckabee as surly Matthew and Dan Shor as the fun-loving Luke (for the record, the Mark of this biblically named family is played by Michael Horton). Shor energizes every scene in which he appears.

In such a mammoth undertaking -- the producers claim the film was longer in preparation and production than the war was in duration -- there are bound to be lulls. Director Andrew V. McLaglen handles the battles grandly, concluding part one with the Battle of Bull Run when congressmen and guests gathered on hillsides to watch while picnicking. The battles are depicted more graphically as the series and the war wear on. It would have been criminal to reduce this ruinous war to the bloodless escapist violence of a TV cop show, and that has been avoided. The horror of Vicksburg and of the Wilderness Campaign are powerfully captured.

Many of the simple dialogue scenes staged by McLaglen, however, fall so flat they look like excerpts from a starchy classroom historical film -- "Sparky Goes to Gettysburg" or something along those lines.

Ian McLellan Hunter, who wrote the script, had to churn up a few spurious loves-at-first-sight every now and then, and he actually has a character exclaim, "Look, there's Jackson, standing like a Stone Wall" (!), but by and large, he makes an unwieldy number of characters not just wieldy, but engrossing. Certain scenes are particularly well conceived or brightened with judicious detail, such as a Union recruiting rally in part one ("90 days of adventure and educational travel," the boys are promised) or an unofficial truce in part two, when a few of the Union boys are invited behind Confederate lines by their rebel relations to enjoy a barn dance.

In part three, there is a brief battlefield truce while two men meet and talk between the opposing camps. "What goes?" asks one soldier, looking at the two men. "Brothers," another explains.

The screenplay is very, very careful to show heroes and villains on both sides. When Lee surrenders, the film is far more reverential to him than it was to Lincoln; how it does go on and on venerating his nobility, with chorus after chorus of "The Bonnie Blue Flag" on the soundtrack. (Otherwise, Bruce Broughton's music is just fine). The man who supervised the hanging of the black man in part one (Warren Oates, no less) is later revealed to be a vicious psychotic, as if to suggest, erroneously, that Southern lynchings were isolated aberrations conducted exclusively by maniacs.

But for the most part, "The Blue and the Gray" scrupulously documents and communicates a time of terrible loss. And it is very often successful in making that loss painful and immediate. The final freeze-frame implies the wounds that resulted healed quickly but, of course, some never did, and some never do.