President Reagan, speaking to the nation in a week of foreign policy crises, last night defended the U.S. invasion of Grenada and the continuing deployment of U.S. Marines in Lebanon as a response to what he called Soviet encouragement of violence and terrorism in both countries.

If the United States had not acted in Grenada or if the Marines were withdrawn from Lebanon, Reagan suggested strongly in his televised speech, the Soviet Union and its "surrogates" would become the dominant force in those areas.

Speaking in emotional terms about the deaths of 225 Marines in last Sunday's suicide terrorist bombing in Beirut, Reagan said, "They gave their lives in defense of our national security every bit as much as any man who ever died in fighting a war. We must not strip every ounce of meaning and purpose from their courageous sacrifice."

But Reagan offered no new initiatives to achieve a peaceful settlement in Lebanon, and gave no indication of how long the Marines would remain there. Nor did he say when U.S. forces would be pulled out of Grenada, beyond pledging to remove them as soon as possible.

In contrast to many of his past denunciations of the Soviet Union, such as declaring in a Sept. 5 speech that the Soviets had committed "a crime against humanity" in downing a South Korean jetliner with 269 persons aboard, Reagan's tone was muted last night.

But he made clear his view that the Soviets were at the root of what he contended was the necessity of a U.S. presence in the Middle East and the eastern Caribbean island of Grenada.

"The events in Lebanon and Grenada, though oceans apart, are closely related," the president said. "Not only has Moscow assisted and encouraged the violence in both countries, but it provides direct support through a network of surrogates and terrorists.

"If terrorism and intimidation succeed, it will be a devastating blow to the peace process and to Israel's search for genuine security," Reagan said in reference to Lebanon. "It won't just be Lebanon sentenced to a future of chaos. Can the United States--or the free world, for that matter--stand by and see the Middle East incorporated into the Soviet bloc?" The president turned to a similar emotional touchstone in defending his decision to invade Grenada with Marines and Army Rangers, which he said was necessary in part to prevent the taking of American hostages.

"I believe our government has a responsibility to go to the aid of its citizens if their right to life and liberty is threatened," Reagan said. "The nightmare of our hostages in Iran must never be repeated."

Underlying his justification for the invasion that began Tuesday morning, Reagan emphasized, also was a perception of Soviet influence, in this case abetted by Cuba.

"We got there just in time," he said, to forestall the creation of a "Soviet-Cuban colony" that would have rendered the island a Cuban military base.

A senior administration official who briefed reporters minutes before the speech said the president's perception of Soviet influence in the Middle East and the Caribbean was a common thread of the speech.

Until a decade ago, this official said, the Soviets passed "an important threshold" and achieved rough parity with the United States in strategic power. As a result, he said, the Soviets have been more willing to take risks in areas such as Ethiopia and Afghanistan.

"There is an apparent probability that we will see more low-level probes" aimed at fomenting violence and stirring unrest in unsettled parts of the world, the official added.

In his speech from the Oval Office, Reagan gave no specific strategy for combating these "probes" but pledged that the United States would not retreat in the face of Soviet power.

"We are a nation with global responsibilities," Reagan said. "We are not somewhere else in the world protecting someone else's interests. We are there protecting our own."

Much of Reagan's speech dwelt on the death and destruction in Beirut last Sunday. Administration officials privately acknowledged that the tragedy has dealt a heavy blow to U.S. foreign policy goals in Lebanon.

The president first raised the issue defensively, noting "how many of you are asking, 'Why should our young men be dying in Lebanon? Why is Lebanon important to us?' "

He answered these questions by reviewing the record of the U.S. commitment in the Middle East, giving a selective history that omitted any reference to the June 6, 1982, Israeli invasion of Lebanon.

Reagan observed that he had offered a Middle East peace plan last year that he said was based on U.N. resolutions "and called for fair and just settlement of issues between the Arab states and Israel."

But before these negotiations could begin, he continued, it was essential to remove all foreign forces from Lebanon.

"So, why are we there?" Reagan said. "Well, the answer is straightforward: to help bring peace to Lebanon and stability to the vital Middle East."

Reagan said that in the year since he had deployed U.S. Marines to Lebanon as part of a multinational peace-keeping force, "Lebanon has made important steps toward stability and order."

He said the attack on the Marines last Sunday was a demonstration not of the failure of his policy but of its success.

"Would the terrorists have launched their suicide attacks against the multinational force if it were not doing its job?" he asked in one of the 15 rhetorical questions of the speech. "The multinational force was attacked precisely because it is doing the job it was sent to do in Beirut--it is accomplishing its mission."

But Reagan offered no hope for a new plan that would bring the Marines home from Lebanon soon. Instead, he restated administration policy in "three steps," which he listed as accelerating the "search for peace and stability in the region," working more closely with U.S. allies in support of the Lebanese government of President Amin Gemayel, and ensuring that the Marines are "given the greatest possible protection."

Reagan's most specific statement about his policy in Lebanon in the aftermath of the bombing was to repeat, in somewhat blunter terms, a statement he made to reporters the day after the incident promising punishment for those responsible for the attack.

"We have strong circumstantial evidence that the attack on the Marines was directed by terrorists who used the same method to destroy our embassy in Beirut," he said. "Those who directed this atrocity must be dealt justice. They will be."

Administration officials suspect that a radical Shiite group, with ties to Iran, planned the bombing. Officials said earlier in the week that the punishment they are talking about involves the responsible group, rather than an attack on another country.

Reagan completed his speech with a characteristic emotional appeal in which he depicted Gen. Paul X. Kelley, the Marine commandant, visiting a seriously wounded victim of the Beirut bombing "with more tubes going in and out of his body than I have ever seen in one body."

The Marine was unable to speak but he signaled for a pad of paper on which he wrote out the words "Semper Fi" for Semper Fidelis, "always faithful," the motto of the Marine Corps.

"General Kelley has a reputation for being a very sophisticated general and a very tough Marine," Reagan said. "But he cried when he saw those words, and who can blame him."

"That Marine, and all those others like him, living and dead, have been faithful to their ideals, they have given willingly of themselves so that a nearly defenseless people in a region of great strategic importance to the free world will have a chance someday to live lives free of murder and mayhem and terrorism," Reagan said. " . . . We cannot and will not dishonor them now and the sacrifices they have made by failing to remain as faithful to the cause of freedom and the pursuit of peace as they have been."

The president presented the U.S. invasion of Grenada as a similar test of national will, in this case pitted against the Cubans and their Soviet supporters.

Reagan reacted in his speech to the objections of the news media that the administration had been deceptive in responding to queries about the invasion beforehand and then had barred reporters from Grenada so the administration could present its own version of events.

He did not refer to these objections specifically but said that "complete secrecy was vital to ensure both the safety of the young men who would undertake this mission, and the Americans they were about to rescue."

Reagan's speech last night came against the political backdrop of growing concern among some of his advisers that the administration may face increasing public and congressional protests to its foreign policies, particularly in the Middle East.

Based on preliminary polls and political soundings, the advisers are more confident of public support for the Grenadan invasion than for the continuing deployment of U.S. Marines in Lebanon, largely because of the high death toll in Sunday's bombing.

Historically, when he has thought he was in political trouble or wanted to mobilize support for a policy, Reagan has turned to a nationally televised speech where he can deliver his message without the intermediary of reporters' questions and interpretations.

The president's public appearances this week have been carefully controlled and limited. He canceled political speeches he had planned for yesterday and today in the West. There are no public appearances on his schedule today and he plans to leave for Camp David, Md., this afternoon, where he will limit his public statements to his weekly radio address Saturday.

Republican pollsters plan to assess quickly the impact of the president's speech to see if he has mustered public support for his policy during what is seen as the major foreign policy crises of his administration.

In the minds of Reagan's strategists, the twin events of Lebanon and Grenada are linked, as they were in the president's speech last night. And this fits in with Reagan's view of the world in which, as he said last week, "a force" will move in and fill vacuums left by U.S. withdrawals.

The president, who was born in 1911, looked back in his speech to a time when the security of the United States "was based on a standing army here within our own borders and shore batteries of artillery along our coasts.

"The world has changed," he said. "Today, our national security can be threatened in far away places. It is up to all of us to be aware of the strategic importance of such places and to be able to identify them."