Secretary of State George P. Shultz raised with American allies today the possibility of taking retaliatory action against the perpetrators of last weekend's terrorist bombings in Lebanon that killed nearly 300 U.S. and French soldiers, according to U.S. sources. But the other countries appeared reluctant to take part in such a move.

Officials traveling with Shultz, who refused to be quoted by name, said there had been discussion of possible reprisals at a meeting here of foreign ministers of the four countries that contribute to the multinational force in Lebanon.

The meeting ended with a reiteration by the United States, France, Italy and Britain of their commitment to maintaining peace-keeping forces in Beirut despite the heavy toll of the bomb attacks.

As of Thursday night, the American casualties were reported as 225 dead and 78 wounded. French fatalities were put at 56.

The report that the four ministers had discussed the issue of retaliation could not be confirmed by officials from the other delegations. Spokesmen for the three European members of the multinational force appeared anxious to distance themselves in advance from U.S. actions designed to punish those responsible for the bombings.

Today's meeting, hurriedly arranged to coordinate a joint response to the attack in Lebanon, also provided Shultz with an opportunity to explain the reasons for the U.S. invasion of Grenada to his critical Western European colleagues. Officials said the issue was raised in a private meeting between Shultz and British Foreign Secretary Sir Geoffrey Howe but was not mentioned in the four-power conference.

Speaking to reporters during his flight back to Washington, Shultz said that there was "a fair amount of strong circumstantial evidence" about the identity of those responsible for the attacks against the U.S. and French bases in Beirut. He added that taking action against the perpetrators would have "a preventive effect" since the "people who did that might like to do it again."

The possibility of reprisals was raised by President Reagan Monday when he said that "this despicable act will not go unpunished." Tonight, in his television address, Reagan said: "Those who directed this atrocity must be dealt justice. They will be."

Officials traveling with Shultz said evidence points to a radical group with Iranian ties operating from a base behind Syrian lines.

Neither Shultz nor other members of the U.S. party would speak in detail about plans for actions against the terrorists, but their willingness to discuss the subject at all was notable and unusual. It also seems to have embarrassed other participants in today's conference even though U.S. sources said there had been no detailed operational planning for possible reprisals.

Speaking to reporters after the meeting, French Foreign Minister Claude Cheysson went out of his way to distinguish French policy in Lebanon and the Middle East from that of the United States. He said that, while French troops serving with the multinational force responded when attacked, the Americans exercised a greater "scope of intervention" and took the offensive even before being attacked.

Cheysson also stressed that France, with its partners in the European Community, believed in a global solution to the crisis in the Middle East specifically taking into account the Palestinian issue. He contrasted this with U.S. attempts to negotiate a separate peace settlement between Lebanon and Israel.

On television last night, French Defense Minister Charles Hernu said the mandate of the 5,800-man multinational force forbade all "police operations." French officials interpret this to mean that responsibility for investigating the circumstances of last weekend's bomb attack and punishing the terrorists rests primarily with Lebanese authorities.

Like Britain and Italy, France interprets the force's mandate as confined strictly to Beirut and its immediate environs while the United States has spoken of a much broader role for the troops.

Italian Foreign Minister Giulio Andreotti, in comments to reporters after the meeting, also cautioned against overreaction. He said members of the multinational force had the right of self-defense but not to shoot indiscriminately against possibly innocent people.

Asked whether the issue of reprisals was raised during the talks, a British spokesman refused to comment.

In a statement as host of the meeting, Cheysson said people of all four countries participating in the multinational force had accepted the sacrifices of lives in the cause of "peace and unity in Lebanon." But he struck a note of impatience with the Lebanese by saying there would be "deep disappointment if all forces in Lebanon" did not do their utmost to bring about a peace settlement.

French President Francois Mitterrand made it clear to Lebanese President Amin Gemayel Monday that he expects Gemayel's government to offer its rivals genuine political compromise in talks among Lebanese factional leaders in Geneva next week, the Manchester Guardian reported from Beirut, citing senior diplomatic sources there.