Martin Marietta Corp., a diversified aluminum, aerospace, chemicals and construction materials company based in Bethesda, yesterday reported record sales and profits during 1977.

Norfolk & Western Railway, meanwhile, reported a 21 percent decline in earnings last year. Higher profits for 1977 were reported by United Virginia Bankshares and First & Merchants Corp., two Virginia bank holding companies.

Profits of Martin Marietta, the largest industrial corporation based here, rose 30 percent to $102 million ($4.29 a share) compared with $78.5 million ($3.32) in 1976. Sales rose 19 percent to $1.44 billion from $1.21 billion.

According to chairman J. Donald Rauth, all of the company's major divisions contributed to higher sales and earnings. For the fourth quarter alone, the company earned $21.5 million (90 cents a share) on sales of $392 million compared with profits of $18.3 million (77 cents) and sales of $314 million in the same three months of 1976.

Rauth said his firm's aggregates division shipped some 45 million tons of crushed stone, sand and gravel last year, an increase of 6 percent. Cement division shipments were up 3 percent to 4.35 million tons, and aluminum shipments were up slightly, at 424 million pounds.

Acrospace employment rose 20 percent last year to more than 12,000, and additional expansion is expected this year. In 1977, the Martin aerospace company received a $14.8 million government "performance award" fee for its work on the Project Viking Mars exploration, but Rauth said that even without consideration of this extra income, aerospace operations were ahead of 1976.

Norfolk & Western Railway, a major coal-hauling line, reported a 44 percent decline in fourth-quarter results.

Reflecting the impact of a strike by the United Mine Workers Union against the coal industry, NW earned $26 million (83 cents a share) in the recent period, compared with a record $46.6 million ($1.49) in the same period of 1976. Revenues also dipped, to $306.5 million from $314.1 million.

For the full year, Roanoke-based N&W earned $103.4 million ($3.31 a share) compared with a record $131.5 million ($4.21) in 1976. Revenues were flat at $1.2 billion. Chairman John P. Fishwick noted that the annual profits were still the third best in N&W history.

He said that, in addition to the current coal strike, N&W profits last year were adversely affected by heavy losses of its Delaware & Hudson Railway subsidiary. The D&H is owned by a subsidiary, Dereco Inc., which suffered a 1977 loss of $11.8 million compared with a loss the previous year of $3.5 million.

Fishwick said coal tonnage originated by the N&W declined 10 percent in the fourth quarter. He forecast that overall 1978 traffic volume will be about even with last year because of the coal strike. But profitability may be aided by lower taxes and other items, he told securities analysts in New York.

United Virginia Bankshares, the largest banking company in the state, reported 1977 operating profits of $17.1 million ($3.18 a share), up sharply from $13.6 million ($2.55) the previous year.

Including profits from selling securities, UVB earned $17.2 million ($3.19) compared with $13.8 million ($2,57).

First & Merchants Corp., another Richmond-based bank firm, reported operating profits in 1977 of $9.6 million ($2.92 a share) compared with $8.4 million ($2.55) in 1976. Net income was $9.5 million ($2.90) compared with $8.3 million ($2.53).

Both banking companies attributed growth in profitability, in part, to increased loan volume during the year.

Macke Co., a food services and vending firm based in Cheverly, reported profits for the first fiscal quarter ended Dec. 31 of $1.15 million (38 cents a share) compared with $937,000 (31 cents) a year earlier. Sales rose to $55 million from $50 million.