It rained.

With that impertinent beginning, the Fourth of July spirit took a wet grip on Washington yesterday, threatening for a while at least to turn the traditional merrymaking in the nation's capital into a dismal mudfest.

Despite morning cloudbursts and continual threats of meteorological high jinks, however, area residents and tourists by the tens of thousands sloshed their way to the Mall to mark the nation's 205th birthday.

In all, an estimated 400,000 people congregated in a slippery sea of plastic drop cloths and garbage bags for rock music and fireworks in the Mall area. And at 6 o'clock sharp, as the Beach Boys struck up their first joyous tune, the sun came out on cue, prelude to a gloriously temperate evening.

The sky was totally clear by the time the first brilliant array of colors burst over the heads of the multitude. When the show ended, and the last "ooh" and "ahh" had faded, the crowd began what was described as a slow but orderly departure. Although traffic oozed and crawled on some major arteries, no serious disruptions were reported either on the roadways or on the heavily burdened Metro subway system.

In a "delighted" mood, White House officials confirmed that press secretary James Brady, still recovering from head wounds suffered during an assassination attempt on President Reagan in March, made his first trip out of George Washington University Hospital to view the 30-minute pyrotechnic display from a downtown hotel.

Brady, wearing a straw hat, also made a brief appearance at a White House "Gay Nineties" picnic. He left before President and Mrs. Reagan arrived from a birthday party for the First Lady at Mt. Vernon.

For the most part, the holiday spectators found event organizers to be every bit as determined as they, sticking to schedules even under the most trying circumstances. At times, the mercurial weather sent hundreds running into museums and others scurrying for the nearest available cover, and helped turn a planned three-hour morning parade down Constitution Avenue into a bedraggled, 45-minute affair.

But it did not deter demonstrators from venting their ire in front of the White House. Nor did it keep gaggles of early-morning arrivals from staking out seats for the Beach Boys rock bash.

Aside from a brief skirmish between police and pot-smoking Yippies at the Reagan residence, and scattered drug arrests in the city's parks, it was a day to take refuge from normal cares and worries, to be with family and friends, to join in the great American party.

For most it began with a disconcerting look out the window, where nature, in no mood to cooperate, displayed her penchant for dirty tricks. Apparently thousands took one look and pulled the covers back over their heads. At least 28 persons, however, were already preparing for a Fourth of July that would mark the rest of their lives. For on this birthday, they would become Americans.

The klieg lights went on at 9:30 in the "We the People" exhibit at the Museum of American History. There, in a makeshift courtroom, dozens of friends, relatives and reporters awaited the swearing in.

The Justice Department had hand-picked 28 candidates for the occasion. As television cameras whirred, they marched in, dressed as for a graduation. Norman Rockwell might have painted their multicolored faces in various poses of reverence, but mostly they stared blankly ahead, standing as their names and native countries were called: Lionel Lowe, Guyana; Penelope Heavner, Great Britain; Hany Makhlouf, Egypt; Sung Do Kim, Korea.

No tears wetted the eyes of these new citizens as they declared their willingness to bear arms, if need be, for the United States.

"I tell you, man," said former Jamaican John Christian, a resident here for nearly 30 years, as he walked from the hall. "Even when I was a kid in school, I was an American, because this is the land of the beautiful."

"Do I feel any different?" said Jose Alcoforado, a Portuguese native who works for the Voice of America. "No. I've been living here 17 years. I guess I just never thought of becoming a citizen before."

At a reception later, 8-year-old Yaqueline Romero, a Columbian whose adoptive American mother took the oath for her, swayed shyly in her sailor's dress and patent leather shoes, nibbling on one finger. Sure, she knew what the Fourth of July is.

"That," she declared, "is when everybody turns American."

Many who emerged that morning from the museum found they had missed what normally is one of the holiday's big events. The Fourth of July parade had already come and gone. Soaked and just a little miserable, marchers had turned quick steps into dead-out runs as they reached the end of the parade route on Constitution Avenue, the entire procession vanishing after 45 minutes.

"We missed it? What? I can't believe this," exclaimed an incredulous Eileen Ormand, a newlywed visiting with her husband William from their home in Cape Cod. "Maybe next year," said he.

Jenny Hasse, wringing out the school banner from Central High in Norwood, Minn., tried not to let her disappointment show. "It was fun, but it was wet," said the 15-year-old marcher. "It's a once-in-a-lifetime opportunity for me."

And the rain picked no favorites. Also searching for a silver lining in the cloud over Washington was the chipper French Count Michel de Rochambeau. A descendant of Lafayette, the count had flown from Paris and put on his tux to ride in the parade.

"Oh, well," shrugged the count from under his umbrella. "The weather in France is lousy, too. It's not normal. Ce n'est pas normal."

By 1:30, the rain had stopped and revelers in Lafayette Park were tossing Frisbees and laying out their picnic spreads. In front of the statue of the French freedom fighter, an Hispanic family of 10 took turns photographing one another, seemingly oblivious to a crowd that had gathered across the street to hear Gloria Steinem and other feminists denounce Reagan economic policies.

"How long must women wait for liberty?" read one banner. The ERA symbol was in abundant evidence on buttons, necklaces and T-shirts. Because the rain had prevented organizers from setting up their sound system, however, speakers resorted to a bullhorn. Hardly a word could be heard.

"I don't know that it's important to hear anything," said Marge Lorenze of Milford, Del. "We know why we're here."

Dozens of police and paddywagons intervened when 25 women linked arms and knelt down to block Pennsylvania Avenue. The women were soon dispersed, but the Yippies were on their way.

Trailing a scent of burning hemp, arrayed in torn jeans, bandannas and American flags, the dissident youths came shouting down the Capitol's main street. Holding aloft a three-foot golden bong, and a banner reading "Pot for People, Not Police," they sent the cops back to their squad cars for gas masks and riot gear.

Once marcher was led away after throwing a firecracker under the horse of a mounted Park Service policeman. But the protest defused without serious incident, causing one officer serious incident, causing one officer to wax nostalgic about the 14th annual smoke-in. Said special operations officer T.E. Kruczek: "I was doing this detail with their parents."

A prime site for picnics and pyrotechnic displays, the Jefferson Memorial is a thicket of human flesh on most Fourths. This year, it was nearly deserted as the leaden clouds lumbered ominously over the Potomac. "We hold these truths to be self-evident . . ." go the words, etched for all generations to see on the monument to the man whose script helped start a revolution.

Only a few stopped to read them. Instead, Americans and foreign tourists alike wandered into the marble edifice, looking briefly around, then standing one at a time at the base of the 19-foot bronze statue to have their "We Were There" photo snapped.

"Get his head in" said a sandy haired boy in a red rugby shirt, drawing a deep breath and puffing out his chest for his father's approval. Click.

The father, Tom Wood of Cleveland, was asked what he thought of being at that spot on the nation's birthday. "I'm a literary person," he said, grimacing a little."It's pretty ordinary." His wife, Karri, thought about that for a moment and said: "It's just a young, young country. There's just so much ahead of us. I hope my children will feel that way."

Later, a red-haired man was spied sitting on one of the marble benches and looking pensively at the walls. An Englishman, it turned out.

"Here for the first time is an idea that people can create their own government and change it any time it suits them," said Reg Green, who moved across the Atlantic and now works as a public relations director from McLean. "It's inspired the world to do the kind of things those words say. And I'm not too sad that Britain lost that war. It seems to me that it was the best thing that ever happened to both countries."

The teeming thousands had waited much of the day, passing the time with beer, fried chicken and long tales of concerts they had known.

Anne Schweitzer, a 17-year-old from Arlington, had arrived at 10 a.m. in the pouring rain, spread out plastic garbage bags and a sleeping bag and crossed her fingers. "I was going to be here whatever happened," she said.

Brad Long, a 22-year-old University of Maryland student, stretched out under a makeshift tent, fashioned that morning from plastic drop cloths and bamboo poles.

And when the Beach Boys opened up with Surfer Girl, any uncertainties and doubts listeners may have entertained simply washed away as teenagers hopped, wiggled and swayed to the beat. "I like being around people. Being close," said Gerald Wise of Arlington. "This place is like one big bar."