For President Reagan, the news of the massacres in the Palestinian refugee camps came as troubling evidence that the government of Israel, which he has long and strongly defended, could not be trusted to keep the peace in Lebanon.

"Israel is no longer David -- it's Goliath," Reagan said during one of the many meetings on the Lebanon crisis that have preoccupied him during the past three days.

The belief that the government of Prime Minister Menachem Begin had dealt in bad faith was a frequent theme during the past three days of consultations among the president, Secretary of State George P. Shultz and their principal advisers, according to sources close to the president.

They said that Reagan, despite being "personally upset" about the massacres, saw world outrage at the killings as an opportunity to force the removal of all foreign troops, including the Israelis, from Lebanon.

"He's intent on bringing Begin to heel, and he's confident that we can resolve it," said a senior administration official yesterday.

Another official said that the president added language to the speech specifically calling for the removal of all troops from Lebanon.

"This is not just a rerun of the last troop movement," he added. "Reagan sees this as a prelude to the withdrawal of all troops from Lebanon. He feels that U.S. credibility is at stake as well as Israel's because we promised to get this withdrawal and to protect those people."

Reagan first learned of the killings in his Saturday morning "take," as the president's daily briefing book is colloquially known around the White House. It is the compendium of overnight reports from the Central Intelligence Agency, State Department and other agencies, and it contained sketchy information on the killings in the camps.

At 10:30 a.m. deputy national security adviser Robert C. McFarlane called with more detailed information. The reaction from the president was described subsequently as "truly profound horror."

"Oh my God," Reagan said, when he was told that many of the victims were women and children.

Reagan asked for an immediate meeting with Shultz, who briefed him in the Oval Office little more than an hour later, at 11:40 a.m. The meeting was also attended by McFarlane and White House deputy chief of staff Michael K. Deaver.

"The president was extremely troubled, you could see it in his face," said one of the participants. "He was shaking his head as Shultz gave the details."

The meeting ended because Reagan had to give his weekly noontime radio speech. He stuck to his script, which was an advocacy of a constitutional amendment allowing voluntary prayer in the nation's public schools.

Shultz returned to the White House at 2 p.m. with the draft of the statement issued soon after by the president expressing "outrage and revulsion" at the killings.

That night, at 11:10 p.m., the president was awakened by a call from his national security adviser, William P. Clark, telling him of a pending vote in the United Nations on a resolution dealing with the Lebanese crisis. Reagan, true to his long-held belief that the Soviets want to cause mischief in the Middle East, was suspicious of a Russian amendment that called for an armed U.N. force to be sent into Lebanon, which neither the president nor his advisers thought Israel would accept.

The instruction, from the president through Clark to U.N. Ambassador Jeane Kirkpatrick, was to oppose the amendment.

The massacres and what the United States should do about them were the prime topics Sunday at the State Department, the Defense Department and the White House. Reagan held discussions with ambassador Philip C. Habib, the special envoy who had negotiated the Lebanese cease-fire.

At 5 p.m. there was a meeting in the White House of Shultz, Habib, Clark, Deaver, Secretary of Defense Caspar W. Weinberger, White House counselor Edwin Meese III and Vice President Bush.

This meeting, described by one participant as a "full discussion of all the possible options," ended with a recommendation to the president calling for resolute action by the United States on Israel.

The proposals were carried to Reagan in the Oval Office at 7:55 that evening. Reagan, in his bathrobe, discussed the options in a meeting that lasted 40 minutes and gave what one source called "the outline of a speech" he proposed to deliver the next day.

The first draft of the speech was presented to the president by Shultz in a meeting the next morning. Reagan commented on the draft, saying that it should emphasize, according to one White House official, "that we must really call for a pullout of all foreign troops."

The final revised draft of the speech that the president gave at 5 p.m. yesterday was then reworked by the State Department and White House speechwriters and was finally approved by Reagan just 45 minutes before he went on the air.

Discussions with administration officials yesterday showed two dominant strains in Reagan's thinking. One was his anger at the Begin government, an attitude that one source characterized as "almost a feeling of betrayal" by the government of a state he has defended since its creation in 1948 when Reagan was a liberal Democrat and president of the Screen Actors Guild in Hollywood.

The other attitude was a determination by the president to ensure that the United States sees its commitment through in Lebanon.

"The president doesn't think this is just a question of Israel's credibility," said one official last night. "He thinks U.S. credibility is at stake, too. He's determined to see the removal of foreign troops from Lebanon."