East German refugees who for almost three months have camped in the West German Embassy in Prague demanding passage to the West embarked on a hunger strike today to dramatize their demands.

Forty of the 68 East Germans still lodged in the embassy began refusing meals today in an effort to intensify pressure on East Berlin authorities, who have refused to grant them immediate exit visas, West German officials said.

In an open letter to the West German press published in the Bild-Zeitung today, the refugees said that all of them, except children and those in poor health, were determined to carry out the hunger strike to impress the East German government with the seriousness of their demands.

They said in the letter that their occupation of the embassy "was the only possible way out of a hopeless situation" caused by the "political conditions in the German Democratic Republic."

They also accused the Bonn Foreign Ministry of muzzling contacts with the press, a charge the West German government later denied.

The refugees also have addressed a letter to West German Chancellor Helmut Kohl, urging him to "help us get out of here. . . . We are at our wit's end."

Peter Boenisch, a spokesman for the West German government, expressed deep regret over the refugees' action and said "such desperate measures will not contribute to a solution of the problem."

West German Foreign Minister Hans-Dietrich Genscher, who is scheduled to make a two-day visit to Prague to discuss East-West relations with the Czechoslovak government, is expected to make a personal appeal to the refugees to leave the embassy and return to their homes.

The Czechoslovak government has refused to intervene, insisting that the refugees' plight is a problem to be resolved by the two German states.

East German authorities, after relenting in the past allowing other refugees who have occupied diplomatic missions to leave for the West, have insisted that they no longer can offer promises of exit visas to those who use "blackmail tactics."

The Communist government in East Berlin has promised that the refugees would not be prosecuted if they returned and sought to emigrate through normal channels.

West German officials stressed today the gloomy prospects for an early settlement. They said that negotiations had reached a complete impasse and that the refugees were likely to remain holed up in the embassy through Christmas.

Ludwig Rehlinger, state secretary in Bonn's Ministry for Inter-German Relations, spent the past two days in Prague pleading with the refugees to abandon their vigil but made no progress.

Wolfgang Vogel, an East Berlin lawyer who is handling the affair as the personal envoy of East German leader Erich Honecker, met with Rehlinger in Prague to emphasize the government's ironclad position that no exit visas will be forthcoming until the refugees return home and proceed with the usual application process.

Rehlinger, who has traveled to Prague several times to speak to the refugees, has urged them repeatedly to abide by East Berlin's conditions because their intransigence has jeopardized emigration prospects for other East Germans who want to move to the West.

West German officials said the excessive psychological strain appeared to be taking its toll among the refugees, who appear guided by a hard-core group of 20 who reject any notion of compromise.

Many of the refugees have expressed anguish about feeling trapped because they fear punishment if they go home. Their frustrations have provoked increasing bouts of irrational behavior and violence, creating friction between the refugees and embassy personnel, the officials said.

In recent weeks, more than 100 East Germans gave up the occupation at the West German Embassy in Prague and decided reluctantly to return home, apparently accepting the unyielding conditions laid down by the government in East Berlin.

West German officials involved in the case said 347 East Germans have tried to get to the West by fleeing into the embassy in Prague this year, with as many as 170 present there at once.