"Heartburn" is a masterpiece, a collaboration of mature artists at the peak of their craft, and something of a summing up for Mike Nichols, who, more successfully than any other American director, has staked out the terrain where men and women meet as his own. Here it is -- a movie that is seriously funny.

Adapted by screen writer Nora Ephron from her novel, "Heartburn" is, quite simply, a tale in which love doesn't conquer all. Rachel (Meryl Streep), a food writer for a Gotham glossy, sees Mark (Jack Nicholson), a Washington columnist, across the aisle at a wedding. Mark isn't just single, a friend tells her, he's famous for it, but the warning doesn't put her off -- they go out for a drink, hop into bed, and quicker than you can say "I do," they're married.

Marriage means a Georgetown town house that they start (and never finish) renovating, dull formal dinners and less formal, if only slightly more interesting, picnics and barbecues with Mark's friends the Siegels (Stockard Channing and Richard Masur) and babies. It also means an affair for Mark with a tall drink of water named Thelma Rice (a vivid Karen Akers).

Rachel uncovers the affair through a stack of credit card bills in the top desk drawer -- a kind of wry joke in the midst of drama. Nichols has a way of turning a prop into not just a plot device, but an ironic commentary on the pain of privilege in contemporary life, on those problems we have simply because we can afford to have them. He has a rare gift for the physical, the specific, and objects in "Heartburn" -- a ring, a recipe, the house itself -- achieve a kind of gravity within your mind, as emotions swirl and settle upon them.

In "Heartburn," Nichols puts that gift at the service of humor. Ephron pulls some of the acerbic lines out of her novel and adds at least one remarkably dizzy monologue (delivered by the peerlessly enigmatic Steven Hill, as Rachel's father). But the humor in "Heartburn" comes from more than dialogue -- it's full of sight gags and pratfalls that at times give it a vaudevillian flavor, and quirky bits of surrealism (like a hilariously apt impression by John Wood of Alistair Cooke narrating Rachel's life as a "Masterpiece Theatre").

"Heartburn" is as adventurously structured as any mainstream movie you're likely to see. Several of the scenes are short, almost like blackout sketches, giving the movie a punch that is a Nichols trademark. Generally, though, the style is relaxed. As cinematographer Nestor Almendros moves his legato camera, or just as often simply sits still, Nichols and his longtime editor Sam O'Steen refuse to cut away for minutes at a time -- scenes in "Heartburn" play out with that balletic slowness that is the mark of complete confidence in the medium.

Part of what made the comedies of the '30s and '40s so much funnier than anything we see nowadays is just this willingness -- a brand of artistic courage, really -- to let the comedy unfold within a mostly static, uninterrupted frame. The very fact that we watched while someone made an ass of himself, and never blinked, itself became part of the comedy.

Nichols follows this strategy in "Heartburn," and the result is a series of classic set pieces, a comedic string of pearls. Streep and Nicholson, for example, are eating a pizza, sitting on the bed in their wreck of a house, singing snatches of songs about babies; Nicholson jumps up and begins braying "My Boy Bill" from "Carousel," almost in its entirety, and, as the camera sits on him as he brays and brays, we become the reaction shot -- it's a subtle way of drawing us into the action.

Those almost unedited takes, following each other in an almost anecdotal fashion, are more than an effective comedic strategy -- their sense of relaxation makes "Heartburn" seem something other than a movie, something closer to life itself, an effect that is heightened by the way the film looks. Cinematographer Almendros has painted the film with his characteristically lovely, natural light, and he's shot it in a deeper focus than he usually uses, so that Tony Walton's detailed production design and Ann Roth's meticulous costumes are brought into relief, giving the film a remarkably vivid sense of time, place and social class. The excellence of the supporting performances add to this texture, particularly Channing as Rachel's wounded alter ego, Catherine O'Hara as a flighty gossip, and director Milos Forman as a vivacious Slavic building contractor.

We experience Rachel and Mark's fragmented marriage as a series of fragments: The long takes, for the most part, follow each other without any obvious or linear logic -- the very lack of connection that leads to their breakup is reflected in the storytelling style itself. These really are simply scenes from a marriage, and much of the important action is both unseen and unspoken -- we never see, for example, Mark and Thelma alone together, just as we never get a scene that explicitly explains why Rachel and Mark got together, or why they fell apart.

Nichols, in other words, is counting on the audience to do some work, extrapolating and making connections from what we're given. The actors have to incorporate what's omitted into the emotions and details of the scenes they play, but luckily, those two actors are Nicholson and Streep.

Nicholson is charming, but it's a different kind of charm than he's shown since, perhaps, "The Last Detail." You don't need to see Rachel fall in love with him because you can see why she'd fall in love with him -- he's jagged, sexy and explosive, chopping the air with his gestures, hurling expletives. Nicholson's unique quality as an actor, his willingness to make a fool of himself, his utter lack of vanity on the screen, is wholly in evidence here, and it gives Mark a sympathetic dimension that he didn't have in the novel -- he may be a heel, but he's a real heel, not a caricature.

Butsw,-3 what's remarkable about Nicholson's performance is the way he realizes that this is Streep's movie and, with a generosity uncommon (to say the least) among stars of his stature, cedes the movie's center to her. The result is a performance in which Streep inhabits Rachel in every detail, from her slouched posture to her snappy, slightly irritable walk to a certain way of holding her head and her hands, and she even seems to have undergone a physical transformation -- the color of her eyes is different, the shape of her mouth changes, wrinkles into pensiveness.

Andsw,-1 while she's lovely, Streep shows you, between the lines, why Mark would want to cheat on her. There's a change in her voice that makes it harsher, deeper -- you see, in snatches, a woman who'd be very hard to live with. And she shows you how the children have replaced Mark in her heart. "Heartburn," in part, says that women are simply better than men, more directly connected to the center of life, but it's also about how men feel excluded by that, and resort to their own men-things as a somewhat pathetic form of self-defense.

When Streep is pregnant (which she is for much of "Heartburn"), she moves in such a way that you don't just watch her pregnancy, you feel it, a pearly translucence suffuses her skin -- she reaches an extreme of vulnerability so palpable, it brings to ordinary domestic strife an element of tragedy.

"Heartburn," though, is no tragedy, and not obviously profound, either -- its moral is nothing more than "life goes on," and its motto something like grace under pressure. What's profound about it is its intimacy. You feel as if you were there, and it happened to you, and its heroism, the heroism of everyday life, is yours.

Heartburn, opening today at area theaters, is rated R and contains profanity and sexual situations.