The chairman of the nation's second largest steel company warned today that Bethleham Steel Corp.'s costs are rising so fast that the company may not be able to meet President Carter's price guidelines.

The steel industry was one of the first to pledge compliance with President Carter's anti-inflation program last fall, a pledge that was hailed as a major victory at the time.

But Lewis W. Foy, chairman of Bethlehem, said today that, although the company has been in complete compliance with the program so far, that compliance is "becoming more precarious every day because of the high rate of inflation."

Foy, who also is chairman of the industry trade association meeting here this week, told reporters that labor and energy costs are rising rapidly.

"Whether we'll be able to stay within the price guidelines under that sort of pressure is a very big question," Foy said.

If the steel industry should violate the president's program-and other executives indicated privately that they face the same sort of wage and energy increases as Bethlehem-it would be a major setback for the program.

Foy said his company may have to "have serious discussion" with the Council on Wage and Price Stability this summer. The council monitors compliance with the president's program.

The president's anti-inflation guidelines ask companies to limit their price increases voluntarily to a level at least a half percentage point below their average price increases in 1976 and 1977.

The program permits companies whose costs are increasing rapidly to raise prices more than they did in 1976 and 1977 so long as they keep their profit margins lower than in 1976 and 1977.

However, the steel industry had two bad years in 1976 and 1977, Foy said under questioning. Although his company is considering a switch to the profit-margin standard, he noted that it would be difficult to do so unless the base years were changed.

The standards are voluntary, but the administration has brought pressure on many industries to comply. Carter also wants to keep wage increases 7 percent or lower, although the administration was willing to bend the guidelines enough last month to call a Teamsters settlement within the standards.

The administration has one weapon it could use on steel companies to keep them in line, it so-called trigger-price mechanism which sets minimum prices for steel imports. The program is designed to protect domestic producers from their foreign competitors who the industry claims are selling steel below cost in the United States.

The administration raised the minimum prices sharply last November-at the same time it announced that major steel executives said their companies would try to company with the price standards. But the Treasury, which runs the program, lowered the trigger prices slightly for the third quarter of 1979 to reflect the decline in value of the Japanese yen. The cost of makine steel in Japan and shipping it to the United States.

Earlier, in his chairman's address to the American Iron and Steel Institute, Foy told his fellow executives they must redouble their efforts to attract women and minorities to the steel industry.