James S. Brady, walking as usual just an arm's length from the president, was shot in the forehead during an assassination attempt on President Reagan yesterday and reported in "very critical" condition after surgery at George Washington University Hospital last night.

Brady, 40, the White House press secretary, apparently was hit by just one of six shots directed at Reagan as the president left the Washington Hilton Hotel. Brady, who was walking at Reagan's shoulder during the shooting, fell to the sidewalk immediately.

He was bleeding profusely from a head wound when he was lifted into an ambulance moments later after lying motionless on the sidewalk in the rain.

At a hospital press conference yesterday evening, Dr. Dennis O'Leary, a hospital spokesman, said the bullet "passed through the brain and came out the other side." Brady's brain "obvisouly" suffered "severe damage" O'Leary said.

Brady underwent elaborate brain surgery last night, with surgeons peering through microscopes at the fine tools needed to clear away the debris left by the bullet and preserve as much brain tissue as possible. The operation ended at 8:15 p.m. after damaged brain tissue was removed.

O'Leary, speaking before completion of the surgery, said Brady was in critical condition, "fighting for his life," and, if he survives, the possibility of permanent brain damage "is likely."

However, at a White House briefing about an hour after completion of the operation, Lyn Nofziger, a presidential aide said Brady had survived the operation with his vital signs stable, his "pupil [eye] reflexes working" and the "prognosis certainly better than it was early in the day."

Dr. Arthur Kabrine, the George Washington University neurosurgeon who performed the delicate operation, told Nofziger afterward that "there may be some impairment but he [Kabrine] doesn't know how much at this time."

Other sources at the hospital said the outlook for Brady was "not good."

Doctors said the bullet, fired from a range of about five feet, struck Brady at the left temple, near the eye, and passed through his head.

Franklin Richards, a third-year medical student who was at the emergency room when Brady arrived, said the press secretary was unconscious on arrival. Richards said Brady, who was bandaged in the ambulance, was not bleeding profusely but that doctors could see bone and parts of his brain emerging from the wound.

At one point, three hours after the shooting, all three television networks reported that Brady was dead. But those reports were denied almost immediately by a White House spokesman, Larry Speakes. "It is not true," Speakes said. "He is in serious condition."

Brady accompanied the president to the appearance before a labor convention at the hotel on Connecticut Avenue shortly after concluding his normal morning White House press briefing at 12:15 yesterday afternoon.

The press secretary had just left a side door of the Hilton with the president when he was felled by one of the shots fired by the alleged assailant. Two others also fell to the sidewalk, struck by the gunfire, as the wound president was pushed by Secret Service agents into his waiting limousine.

Brady's wife, Sarah, was at the hospital early yesterday evening. A friend said she was "crying very lightly" as she was briefed on her husband's condition by doctors.

Brady, a jovial man whose pungent sense of humor usually charmed the press but sometimes left his bosses less impressed, was a late-comer to the Reagan campaign.

Brady, a native of Centralia, Ill., started the 1980 presidential campaign as press secretary to John Connally, sticking with the former Texas governor until that ill-fated campaign was crushed by Reagan in South Carolina.

Brady quickly moved over to the front-runner's staff but, even as the "director of public affairs and research" in the traveling Reagan entourage, he was not a true insider during the campaign.

His sense of humor emerged quickly aboard the Reagan plane. Once, shortly after Reagan had gotten into hot water for an offhand remark that trees were a major source of air pollution, Brady walked through the press section of the plane, pointed down to a forest fire they were flying over, and shouted, "Killer trees, killer trees!"

The reporters thought that was very funny; some of Reagan's oldtimers did not.

Still, Brady had a sense of confidence about himself as well as a sense of humor. He loves to cook, often taking to the kitchen in his modest Arlington home to serve gourmet dinners to his wife, Sarah, and his 2-year-old son, Scott. He also has a college student daughter, Melissa, by an earlier marriage.

Most of his adult life he spent working in politics, starting as a 20-year-old in a 1960 Illinois campaign for the then-Senate minority leader, Everett Dirksen. He also worked for Sen. William Roth (R-Del.), doing some of the first ground-breaking with the press on the Kemp-Roth tax bill that Reagan came to adopt.

Brady's move into the White House, a move he wanted to make badly, came after a much-ballyhooed search for a press secretary.

Reagan insiders seemed to shunt Brady aside, interviewing half-a-dozen reporters while Brady waited. Word slipped out that Nancy Reagan wanted a "good looking" press secretary to go before the cameras for her husband. Some thought that was aimed at Brady, a round-faced man nicknamed "The Bear."

Brady was acting press secretary at the time. His first words to the press after that report were: "I'm not here today as just another pretty face. I've got some news to give you."

When he eventually got the job, the outgoing press secretary Jody Powell, sent him a bulletproof vest -- a Powell joke intended to give him protection from the nonstop assults from reporters. Pinned to the vest was a note that said: "I hope you never need this."

On Inauguration Day Brady was pressed by reporters about the Reagan entourage's insistance on wearing morning coats to the ceremoney.

"People are tired of sack cloth and ashes," Brady responded. "Actually, I understand it was the OSHA inaugural inspectors. They went up to the Hill and decided all the polyester up there would create a fire hazard."

Still, friends said it was no more fitting to write Brady off as a punster than it was to say he wasn't pretty enough for the job.

William Greener, an assistant press secretary in the Ford administration and a Brady friend, called him "an absolute, complete professional." Other friends said he had "a photographic mind" that he used the memorize everything from football statistics to Reagan's wide-ranging campaign positions, a cramming he took on after the election as he hoped to get the press secretary's job.

And, in the first 70 days of the administration, Brady was gathered closer and closer to the inner group around the president. Lately, Mrs. Reagan had taken to calling him "the Y 'n' H" -- shorthand for "the Youngest and Handsomest" and also shorthand that meant that Brady had arrived.

Brady's wife, Sarah, once was the director of administration for the Reagan National Committee. But she quit work after Brady took the press secretary's job -- a job he called "the second toughest in the administration."

Sarah Brady said she had decided to stay home with their 2-year-old son because of the demands of Brady's job.

"If something like Jim's job is going to come at a certain time in life, I suppose the perfect time is now," she said earlier this month. "We waited until late to have a child, and now that he's 2, I like being home with him."

She added that she was excited about her husband's job, then added quickly: "Although I may, just six months from now, say 'God, I was really naive."

One of Brady's favorite lines was provided by someone else: a reporter who inadvertently turned around the old show-business line about "the smell of the greasepaint, the roar of the crowd."

Brady loved that one, and fell back on it whenever he wanted, to give a neutral answer, especially to a personal question. Last week, two months into the Reagan presidency, a reporter asked Brady how it was going, how it really was going.

"Oh, you know," Brady replied, "the roar of the greasepaint. . . ."