Martin Marietta Corp., in a bold move to diversify away from its aerospace and troubled construction-material base, has invested $25 million in three biotechnology companies.

Among the companies invested in by the Bethesda-based firm is Molecular Genetics Inc., of Minneapolis, one of the few biotechnology firms to go public in the past year. A Molecular Genetics spokesman said Friday that Marietta paid $11.9 million for a 21 percent share of the company, which is using genetic technology to develop corn hybrids and animal health care. spokesman for Molecular Genetics said Martin Marietta approached the company seeking to invest and that executives of the two companies agreed in late October on the basics of the deal, under which Marietta will pay $9.50 a share for 1.25 million Molecular Genetics shares in a transaction between the two companies.

Analysts consider Molecular Genetics one of the most promising of the new breed of genetic-engineering firms because of its plans to limit its products to the agricultural field. After a burst of Wall Street enthusiasm over genetics firms a couple of years ago, the biotechnology industry has been undergoing a shakeout recently, with some companies being forced to file for bankruptcy.

The other two companies in which Marietta invested--Chiron Corp., of San Francisco, and Native Plants Inc., of Salt Lake City, are privately held. Chiron produces vaccines, viral diagnostic products and hormones for human and animal health care, and Native Plants is using genetic engineering to modify crops, trees and soils to improve plant varieties.

Marietta did not disclose the size of its investments in Chiron and Native Plants, except to say that it would own between 10 percent and 20 percent of the companies. Marietta will get places on the boards of all three companies.

Marietta said it had been doing research and development work in the biotechnology area for the past 25 years, and plans to "assume a leading role in cooperative programs aimed at penetrating major agricultural, health and industrial markets."

Marietta announced the diversification moves on Friday, a day after it revealed plans to close or sell a Pennsylvania cement plant, and a few weeks after it said it would close a cement plant in Maine.

With the recession sharply curtailing construction, Marietta has said its cement and aluminum operations will lose money this year, and the write-off connected with the closing of the Maine plant will wipe out any fourth-quarter profit for the company, Marietta said recently. Marietta's chemical and sand and gravel operations are also doing poorly, with the recession to blame.

Even Marietta's strongest operation, the manufacture of missiles, rockets and other aircraft equipment, faces uncertainty in coming years because of congressional resistance to the MX missile program, on which Marietta is a major contractor, and the possibility that Marietta's Pershing 2 missile could be bargained away by the United States in arms-limitations negotiations with the Soviet Union.

Martin Marietta also is in the process of cleaning up its balance sheet in the wake of its protracted battle to stave off a takeover bid by Bendix Corp. last summer. The fracas -- which ended with Allied Corp. buying up Bendix and getting a 39 percent stake in Marietta -- added $900 million to Marietta's outstanding debt. Earlier this month, Marietta announced plans to sell $75 million in convertible exchangeable preferred stock as the first step in reducing the debt.

Marietta wasn't the only participant in the battle to feel a financial squeeze. Bendix said on Friday it expected to post a loss for its first fiscal quarter ended Dec. 31 because of the costs of the fight. Bendix, whose merger with Allied should be complete by early next year, did not elaborate on the statement.