President Reagan, cracking jokes through his first day of exercising authority from a hospital bed, was making an excellent recovery yesterday from a bullet fired into his chest, apparently by a former neo-Nazi who pulled the trigger in an attempt to impress a movie actress.

"He is in excellent spirits. All of his vital signs are entirely normal. He's on almost no medication," said Dr. Dennis O'leary, the dean for clinical affairs at George Washington University.

O'Leary estimated that the president will be hospitalized for another week or two and that it will probably be "a couple of months before he is totally back to riding horses." He said he did not think Reagan required "any intensive level of medical care."

The only somber moments in the president's cheerful day of recovery from a wound and an operation that he withstood like a much younger man came at 12:16 p.m., when White House doctor Daniel Ruge told him that press secretary James S. Brady and two other men also had been shot.

"Oh, damn. Oh, damn," Reagan responded, and his eyes filled with tears, White House chief of staff James A. Baker III told reporters.

"That means four bullets hit. Good Lord," said the president, who had only seen one man fall to the sidewalk before he was knocked into his limousine by a Secret Service agent and rushed away.

White House counsellor Edwin Meese III said that as he was being wheeled into surgery Monday Reagan asked about the man he had seen fall, and aides had not wanted to distress him by giving a complete report on the casualties.

Brady, whose life appeared to hang in the balance as he underwent extensive brain surgery Monday, appeared to be making an extraordinary recovery. Brady would live, but had sustained "fairly extensive damage of the right hemisphere of the brain," O'Leary said in the morning.

Reports from the hospital grew more optimistic throughout the day, as Brady showed ability to wiggle his toes and follow other commands. O'Leary was cautious in predicting Brady's chances for recovery, however.

"In cases like this the spectrum of possible outcomes is very wide," he said. "We are cautiously optimistic. You can keep his lungs and heart going, but you don't know what he has left in his head."

Brady's 74-year-old mother rushed to Washington from her home in Centralia, Ill., in a plane provided by Gov. James R. Thompson. She joined Brady's wife, Sarah, at his bedside. His 85-year-old father, Harold, a retired railroad worker who recently suffered a stroke, remained at home.

Timothy J. McCarthy, the Secret Service agent who was gunned down with a bullet in the abdomen, was reported as doing "extremely well." D.C. police officer Thomas Delehanty, who was shot in the neck, improved yesterday from "serious" to "fair".

Meanwhile, at the White House, Meese and Baker worked with Vice President Bush to convey the impression that the crisis had passed and that it was business as usual.

"The president is running the country," Baker said. At a Cabinet meeting called to report on the president's condition and discuss the continuing business of government, the president's chair was empty. Bush presided, but he sat in the vice president's chair.

"It's pretty much business as usual with the vice president pinch-hitting for the president," said Bush's spokesman, Pete Teeley.

Bush will act in the president's place, but Reagan remains the president. To demonstrate his authority, he signed a bill canceling an increase in dairy price-support payments.

He signed it on his hospital breakfast tray about 7:15 a.m. after, Baker said, the president opened the first George Washington University Hospital senior staff meeting with the joke: "Hi fellas. I knew it would be too much to hope that we could skip a staff meeting."

New details of the lonely, directionless life of John W. Hinckley Jr., who is accused of attempting to kill Reagan with a .22-cal. revolver, came from a letter seized by D.C. police from the hotel room where he was stayed in Washington and from leaders of the neo-Nazi National Socialist Party in Chicago.

The letter reportedly revealed that Hinckley had a fantasy relationship with actress Jodie Foster, 18, who played a youthful prostitute in the movie "Taxi Driver," and wanted to impress her. Sources also said it indicated that he might be seeking to commit a crime that would "get himself killed."

Foster is a freshman at Yale University, where she made her stage debut last week in a student prison drama entitled, "Getting Out."

The president-elect of the National Socialist Party said Hinkley was expelled in 1979 because he "wanted to shoot people and blow things up." Michael C. Allen said Hinckley had joined sometime after March 12, 1978, and was dropped from the membership rolls on Nov. 9, 1979.

Hinkley was a "storm trooper" for the party, one of the men who protected its leaders, but Allen said the troubled son of a wealthy Colorado oil executive "was just uncontrollable."

In Lubbock, Tex., an apartment maintenance man who spoke twice with Hincley recalled a conversation during last year's presidential campaign in which the suspect said all the presidential candidates should be "eliminated except Libertarian Party candidate Ed Clark, whom he supported.

Hinckley was being held yesterday under extraordinary security at the brig on the Quantico, Va., Marine training base. He has been charged only in the shooting of Reagan and McCarthy, but other charges are pending.

In an intensive-care room described by Reagan's deputy chief of staff, Michael K. Deaver, as barren, Reagan was performing like the master of ceremonies assigned to keep other people's spirits high in a time of trouble.

As if he were not the wounded 70-year-old victim of an attempted assassination, Reagan was bantering with aides, doctors and nurses, first in written notes and, after 3 a.m., when the tubes were removed from his nose and mouth, by voice.

"I always heal fast," he told a nurse.

"Keep up the good work," she responded.

"You mean this may happen several more times?" he joked.

In the busy recovery room after he came out of the anesthetic following his three-hour-long chest surgery to remove the bullet that punctured his left lung, Reagan remarked:

"If I got this much attention in Hollywood, I'd never have left."

The president's jokes, relayed by O'Leary and White House aides, helped bolster the impression of a leader in command, relaxed and as full of the Reagan optimism as he was before the bullet struck him.

His remarkably rapid recovery, which left O'Leary saying "I am really stunned by how alert and with it he is," was attributed to his extremely strong health despite his age. But Reagan apparently planned to exceed his doctors' predictions.

When they told him that it would be two or more months before he could ride horses again, the president held up one finger in silent disagreement, Deaver said.

"The president is requiring almost no pain medication at all. He is tough in a good sense," O'Leary said.

"He's obviously able to function right now in terms of his thought process, capacity to make decisions and so forth," O'Leary said in the morning.

"What a constitution that Irishman has," Sen. Paul D. Laxalt (RNev.), one of Reagan's close friends, said in admiration.

Reagan didn't know he had been hit until he was examined at the hospital, and Secret Service agent Jerry Parr originally ordered the limousine to take the president back to the White House. En route, however, Reagan complained of a soreness in his rib cage and a bit of difficulty breathing, and Parr ordered him taken to the hospital.

"He had walked into the hospital on his own, under his own power, and fallen, sort of passed out there in the energency room," Baker told reporters. fReagan was given blood transfusions, and his condition was restored to stable. r

Down the hall from Reagan's hospital room a White house command center was equipped with all of the communications equipment that goes with the president on all his travels. Baker said the secure White house communications were operating within 45 minutes of the president's arrival at the hospital.

Dave Fisher and Helene von Damm, two personal aides to the president, were in the command center, as was a military aide with the secret codes the president would need in the event of confrontation with the Soviet Union.

Baker said that any question needing a decision would be telephoned to the president. The top White House advisers also will visit the president once a day or more often as they shake down the new logistics of government.

Baker held a mid-afternoon news briefing in an attempt to deflate reports of new tension between Secretary of State Alexander M. Haig Jr. and senior White House advisers as a result of Haig's role during the tense hours before it was known that the president would come through his ordeal so well.

Responding to reports that Reagan's closest aides were once again angry at a grab for power by the secretary, Baker said, "The White House staff is not displeased at all with the secretary's performance yesterday [Monday]. We think the entire government functioned well yesterday. We particularly think he functioned well yesterday here as the contact in the situation room."

Baker acknowledged that there had been a disagreement between Haig and Defense Secretary Caspar W. Weinberger during the hours that the president was undergoing surgery, but he refused to say what it had been about. p

David Gergen, a deputy to Baker, said: "Al Haig did one hell of a job down there, and we really thoroughly appreciate what he did."

Gergen said the Haig-Weinberger dispute was not over who was in charge. "That's very clear," he added. Gergen said there werre no shouted exchanges, and sought to play down the dispute. Other sources said Weinberger was upset by Haig's emotional claim Monday to have authority in the line of executive power and by the nature of increased readiness ordered for U.S. forces around the world.

Haig and a majority of the Cabinet had assembled in the Situation Room to await word of Reagan and the return from Texas of Bush. Under terms of the 25th Amendment, if the president is not in condition to declare his own disability and transfer power to the vice president, the transfer can be accomplished by a majority of Cabinet members and the vice president.

Baker said he and Meese discussed the possibility that the president should transfer power when they met at the hospital minutes after Reagan had entered the emergency room.

He said it was the only time period during which the president was incapacitated was while he was under an esthesia or recuperating from anesthesia, "There would not be any even preliminary steps taken toward the 25th Amendment, that the best approach as far as the country and the American people were concerned would be business as usual, to the extent that that could happen."

To that end, Bush invited the Senate leaders of both parties to the White House yesterday morning for a briefing on the president's condition and the procedures that the White House aides would follow while the president remained hospitalized.

Minority Whip Alan Cranston (D-Calif.) said the meeting was called "to assure us that things were normal and if we wanted to reach people down here, we should call the regular people, they'll be here." He said he thinks that the planning triggered by the attempted assassination has "gone very smoothly and very effectively."

The senators were assured, as Majority leader Howard H. Baker Jr. (R-Tenn.) said, that there had been no Monday interruption "in the chain of lawful command."

Baker told reporters that the somewhat confusing report Monday of a command authority that would pass in succession from president to vice president to defense secretary would only be implemented in a dire military situation. It "only applies in a narrow set of circumstances, range of circumstances. It's classified," Baker said. He said that an emergency system is established at the outset of an admiration and can be changed at the president's direction.

Despite their joy that Reagan had come through his operation so well, White House officials remained grave about Brady, 40, who was reported by doctors to have lost a good deal of the right hemisphere of his brain. His left hemisphere is dominant, however, O'Leary said.

The doctor who acted as spokesman for the hospital said: "In patients like this the spectrum of possible out comes is very, very wide."