A GREAT American movie in a new epic form, "The Right Stuff" fuses the comic and the heroic to emerge as a knockabout social comedy that also packs a thriller inspirational and -- why deny it?-- patriotic wallop.

Opening at area theaters this Friday, after a gala premiere to benefit the American Film Institute tonight at the Kennedy Center, "The Right Stuff" may be the first rollicking epic ever made. And it's all the more appealing because this mixture feels true to life, adhering to both the tone and subject matter of Tom Wolfe's best-selling chronicle of the formative years of the American space program, from the October 1947 flight of the Bell X-1 rocket plane in which an Air Force captain named Chuck Yeager first broke the sound barrier up through the final solo flight of the Mercury astronaut program in May 1963, with Gordon Cooper aboard, demonstrating the style of disarming, deadpan grace under pressure established by Yeager himself.

Director Philip Kaufman has assembled a terrific group of character actors and emerging young stars, and then has orchestrated moments that will leave their work permanently imprinted on the sentiments of moviegoers. In fact, the movie is more impressive at character delineation than high-flying pictorial spectacle. Kaufman is so good with actors and social contexts that he tends to set one up for letdowns only when reaching for metaphysical ironies or reverberations that remain obscure.

Some of the actors become comic partners. Jeff Goldblum and Harry Shearer play a pair of presumptuous young government bureaucrats who become "crack" recruiters, charged with scouting astronaut material in the panicky aftermath of Sputnik I.

A seven-man comedy troupe from San Francisco known as "I fratelli Bologna" was chosen to impersonate a "permanent press corps" that hovers around the heroes, who must learn how to exploit this unruly communal beast for the success of their mission. A collection of Germanic rocket scientists plague the Mercury astronauts by preferring a space program that deemphasizes or eliminates the human factor--the very factor the tenacious Original Seven manage to salvage.

The astronauts occasionally function as a second seven-man comedy team, with Ed Harris' John Glenn supplying a form of bright-eyed, bushy-tailed and high-minded agitation that the others don't necessarily welcome. Nevertheless, his straight-arrow ardor sweeps the rest of them along, as in the mob scene of the astronauts' first press conference, or brings their hostilities to a useful conclusion, as in an argument over promiscuous sexual behavior that ends up unifying the men against their tormentors within the NASA medical-engineering establishment.

This camaraderie is anticipated by the supremely laconic rapport of Sam Shepard as Yeager and Levon Helm as his friend Jack Ridley when preparing for the historic X-1 flight.

Having busted a couple of ribs while playing tag on horseback with his wife Glennis (Barbara Hershey) the night before the flight, Yeager confides that he has a little problem--"I'm not gonna be able to lean over and shut the damn door." Ridley takes this in equally casual stride, approaching a nearby janitor with the salutation, "Mr. Russell, we got a small emergency," and proceeding to saw off a foot or two from his broom handle to supply Yeager with a lever. The no-sweat pretense continues when Yeager is lowered into the X-1, mounted in the bomb bay of a B-29. They have a set routine, echoed with slight variations throughout the movie, for finessing the dry-mouth sensation likely to confront a test pilot before placing his hide in danger of speedy incineration: "Got a stick of Beeman's?" Yeager asks, and Ridley allows, "Yeah, I might have a stick to spare."

The movie takes its initial humorous reading from the impeccably dry pilots' idiom shared by Yeager and Ridley, then systematically works in an abundance of related or contrasting idioms, belonging to other pilots, their wives and the wacky outside world of bureaucrats, politicians and publicists. Eventually, this world overwhelms the unknown fraternity of postwar test pilots stationed in the Mojave Desert and creates an exorbitantly celebrated new fraternity in their successors, the Mercury astronauts, based in booming urban Houston.

Kaufman's cleverly constructed screenplay establishes a number of identities and seemingly casual remarks calculated to echo ironically throughout the story. For example, the promise of "a free steak dinner and all the trimmings" by saloonkeeper Pancho Barnes (Kim Stanley) to the first pilot to break the sound barrier returns in haunting fashion when Gus Grissom reacts to the Houston Astrodome blowout for the astronauts staged July 4, 1962, by observing, "the steak tastes about the same but there's sure a lot more trimmings."

The Mercury program ends up threatening rocket-plane pilots like Yeager with obsolescence, but his personal example and authority remain spiritually vital and indestructible. He's never on intimate terms with the men who become astronauts, but Kaufman sustains Wolfe's theme that he embodied a heroic ideal that they inherited and emulated. The film even goes a little further by inventing a scene in which Yeager gives his explicit blessing to the men of Mercury at one of their least auspicious hours--the aftermath of Grissom's near-fatal splashdown. Yeager, who had earlier coined the phrase "Spam in a can" to describe the Mercury program, refuses to go along with the second-guessing of Grissom that runs rampant inside the service. "It takes a special kind of man to volunteer for a suicide mission," he asserts, "especially one that's gonna be on TV. Old Gus did all right."

Although it runs 181 minutes and attempts to keep about two dozen characters in more or less prominent focus, "The Right Stuff" never feels sprawling or absent-minded. The pace is crisp and deliberate but never hurried. Indeed, false urgency is a comic attribute of ignorant or anxiety-ridden civilians, who can only participate vicariously in the men's missions.

Perhaps a bit unfairly, the movie exploits Vice President Lyndon Johnson (Donald Moffat) as the example of this behavior, seizing on comments like, "I'll be damned if I'll go to bed by the light of a communist moon," and building a comic highlight around his fury at Annie Glenn's refusal to let him comfort her on national television after John's mission is initially scrubbed. The exterior shot of Johnson's limo bouncing in impotent rage is pictorially priceless, and his lament "Can't anyone around here deal with a housewife?" may be even funnier as an expression of thwarted authority.

Kaufman can be faulted for playing a bit fast and loose with the historical record for comic effect, and down the stretch he scrambles the chronology of three events--the Astrodome party, Yeager's bailout during a test flight of the NF-104 and Cooper's mission--to an extent that is emotionally deflating. Nevertheless, an indispensable element in the movie's appeal is its fidelity to the facts recalled in Wolfe's book, including facts that don't flatter the historical personages. I don't doubt for a second that "The Right Stuff" is going to make millions of people feel gloriously proud to be Americans, or proud to identify themselves with Americans, but one of the profoundly heartening things about this movie's patriotic impact is that it comes without sanctimonious, bombastic forms of expression. The comic presentation also enhances patriotic feeling by purging it of cliche'd reactions.

"The Right Stuff" celebrates a humanly scaled heroism exemplified by acts as winningly down-to-earth as John Glenn's adamant refusal to permit the vice president to pester his wife or Alan Shepard's heartfelt prayer on the eve of his launch, "Please, Lord, don't let me ---- up." It's not as if the need for physical courage is denied; moreover, the illusion of claustrophobia and tingling, stomach-churning sensory apprehension that Kaufman and cinematographer Caleb Deschanel get into the subjective moments of confinement inside cockpits and space capsules ought to correct any lingering misimpression that flying supersonic aircraft is a strictly routine technician's task. However, the movie's determination to portray the Mercury story with all the outrages, blunders, foibles and warts in plain view gives it a rare, far-reaching heroic authority and authenticity.

In this respect I suppose "The Right Stuff" partakes of the same underdog appeal that works for movies like "Rocky," but when it pays off, it makes the "Rocky" sort of dividend look like very small emotional change.

Kaufman succumbs to certain mythic brainstorms that throw the picture slightly out of kilter now and again. The opening sequence reaches for an effect that is merely overblown, and there's an equally unsatisfying note at the fadeout, which feels abrupt and glib. Sam Shepard's beautifully lean, rawboned presence has encouraged the director to lean a bit heavily on pictorial associations with classic Western heroes, especially Gary Cooper, during the Yeager sequences.

A remarkable cinematographer, Deschanel authenticates the historic periods. His work for "The Right Stuff" is as impressive as Gordon Willis' period evocations in Francis Coppola's "The Godfather" and Woody Allen's "Zelig."

But by crosscutting from the Astrodome party to Yeager's near-fatal test flight of the NF-104, Kaufman is guilty of a perilous anachronism, since these events were actually separated by about 18 months. Instead of trying to juggle ironies that have no basis in fact--Yeager's life was not in peril while the astronauts were being wined and dined and subjected to a Sally Rand fan dance in Houston--Kaufman would have been much better advised to stick with the Wolfe chronology and exploit Yeager's ordeal as a terrifying heroic epilogue. Yeager gets lost in this crosscutting misconception, disappearing in the folds of Sally's fans in mid-plummet. While Kaufman retrieves him on the ground moments later, anyone who has read Wolfe's scintillating cinematic description of that terrible descent will regret the failure to stick with the courageous suffering airman all the way down.

Despite these nagging miscalculations, the movie is obviously so solid and appealing that it's bound to go through the roof commercially and keep on soaring for the next year or so. It will be interesting to see if the Motion Picture Academy has the gall to reject this one when Oscar season rolls around. I think not, despite the capricious endorsements of both "Gandhi" and "Chariots of Fire" the past two years.

Unless I miss my guess, "The Right Stuff" is also primed to conclude a process of unofficial national morale-building that began in 1977 with the release of "Star Wars," which George Lucas envisioned, in part, as an inspirational boost for the space program. This process also involves a renewed respect for the military as a calling and career, and I think an obvious progression can be traced from "Star Wars" to "An Officer and a Gentleman" to "The Right Stuff." Even Jane Fonda has rediscovered patriotism through the grace of Sally Ride and NASA, and only the sorriest remnants of the counterculture would bother pretending anymore that they didn't feel a twinge of envy and excitement each time the space shuttle takes off. It would require a fanatic devotion to outmoded ideology to accuse "The Right Stuff" of dreadful reactionary tendencies, since there's never been a patriotic epic that carried its patriotism more modestly or amiably.

It is, of course, remarkable to have a situation in which a leading political candidate finds himself being portrayed in a blockbuster attraction on the eve of the presidential primaries. Ed Harris' magnetic portrayal of John Glenn cannot possibly harm the senator's chances. But "The Right Stuff" is scarcely a one-man show; moreover, it can be plausibly argued that Sam Shepard's performance as Chuck Yeager or Dennis Quaid's as Gordon Cooper or Scott Glenn's as Alan Shepard will impress moviegoers more than Harris' work as John Glenn. Nevertheless, as every guy knows, it means something to be a member of the brotherhood whose trials and accomplishments are celebrated so enjoyably in "The Right Stuff."