wo homemade bombs placed on a railway line leading to the U.S. Rhein-Main Air Base near Frankfurt were found and defused this morning, thwarting another attack against the American military presence in West Germany.

U.S. military and West German police spokesmen said the two 13-pound bombs were discovered by two American servicemen on their way to the airfield, which is near the Frankfurt airport and is a major transit point for the nearly quarter of a million U.S. troops in West Germany. The incident was the fifth directed against American forces here in the last three weeks.

At the same time, a Frankfurt newspaper reported receiving a letter attributed to the leftist terrorist Red Army Faction claiming responsibility for yesterday's attempt to assassinate Gen. Frederick J. Kroesen, the commander of the U.S. Army in Europe.

The style of the message appeared to conform with past Red Army Faction messages. While police have not confirmed the authenticity of the claim, West German authorities continued to operate on the strong suspicion the terrorist faction was behind the expertly planned morning attack on Kroesen near U.S. Army headquarters in Heidelberg.

The three-page letter, mailed four to 12 hours after the attack, from Aschaffenburg, about 30 miles northeast of Heidelberg, said the grenade and gunfire ambush had been carried out by the Gudrun Ensslin Commando, named after a faction leader found dead in her prison cell four years ago.

The letter described Kroesen, who escaped with slight injuries, as "one of the U.S. generals responsible for imperialist policy from Western Europe right down to the gulf."

Written in often rambling revolutionary language, the letter urges attacks on "the centers, the bases and the strategists of the American military machine" and calls on sympathizers to "fight against the imperialistic war in international class warfare." It ends: "Fight with us. Red Army Faction."

The Frankfurter Rundschau, a left-of-center paper, had also received a similar message earlier this month in which the faction, popularly known as the Baader-Meinhof gang, after the names of two founders, took responsibility for a bomb blast on Aug. 31 at the U.S. Air Force base in Ramstein in which 20 persons were injured.

The return of the Red Army Faction after four years of seeming dormancy is being interpreted by West German authorities as an attempt by the left-wing extremists to exploit opposition here to U.S. defense and foreign policies. The opposition has been reflected in several recent demonstrations, including one Sunday when U.S. Secretary of State Alexander M. Haig Jr. visited West Berlin.

Sensitive to the effect the terrorism and the rising anti-American violence might have on an already tense domestic political atmosphere here, the West German government today issued a statement that said such actions "are not only attacks against our American allies but just as much against our own security and freedom." The statement added that Bonn would make every effort with the Americans to stamp out terrorism.

The explosives found today were packed in cylindrical fire extinguisher cases and contained a timing device. They had been placed about 200 yards from the air base, along a spur line that connects the base to the main Frankfurt-Mannheim rail link and is used exclusively for transporting supplies to the large U.S. facility.

Police began analyzing the explosives and declined to speculate on how great an explosion the bombs might have caused. Nor could they connect the bombs to terrorist groups.

Meanwhile, at a press conference in Heidelberg, Kroesen said today he did not believe the new extremism in West Germany would affect U.S.-German relations. He spoke gratifyingly of the "outpouring" of messages of concern he said he had received since yesterday from Americans and West Germans after the attempt on his life.

In answer to questions, Kroesen disclosed that the armor-plated Mercedes in which he, his wife, a military aide and a West German police driver were traveling had only recently been provided by Heidelberg city authorities as a security precaution. He credited the car with saving his life.

He also said of the terrorists, "I'm glad they weren't using American weapons"--a reference to the Soviet-made rocket-propelled grenade launcher that police believe the assailants used and that surprised investigators by not causing greater damage when it hit the rear of the vehicle.

Kroesen said he had been warned some time ago of the need for increased security measures. The warning, he said, came after a West German police raid last autumn on a suspected terrorist hideout in Heidelberg, where police reportedly found documents targeting U.S. military personnel and institutions for terrorist attack.

Police had been led to the hideout by information found at the scene of a car accident in July 1980 near Stuttgart in which two Red Army Faction members, Juliane Plambeck and Wolfgang Beer, were killed.