Martin Marietta Corp. yesterday announced a 15 percent increase in its third-quarter earnings from continuing operations. But a $365 million writeoff the Bethesda-based company announced last week in connection with its departure from the aluminum business gave it a net loss in the latest quarter of $324 million.

The aerospace and technology conglomerate has signed an agreement in principle to sell the bulk of its aluminum interests to Comalco Ltd., an Australian firm, for $400 million in cash and notes, and plans to either sell or close its remaining aluminum operations, raising another $100 million. The aluminum business has been a drag on the company's earnings for some time.

Marietta said it earned $45.5 million ($1.22 a share) from continuing operations in the quarter ended Sept. 30, compared with $39.4 million ($1.16) earned from continuing operations a year earlier. In last year's third quarter, net earnings were $33.1 million, including the aluminum operation.

The company said revenue from continuing operations had jumped sharply in the latest quarter, rising 23 percent to $1 billion from $810.9 a year ago. The company attributed the increase to strength in all of its major lines of business, particularly aerospace.

For the nine months ended Sept. 30, Marietta had a $142.7 million ($3.87) profit on continuing operations, up 10 percent from $129.7 million ($4.10) a year earlier. Last year's figures include $43.1 million in nonrecurring gains from the sale of some of the company's operations in the first nine months of 1983.

The aluminum writeoff gave the company a net loss of $225.1 million in this year's nine-month reporting period; last year's nine-month net income, including the now-discontinued aluminum operations, was $103.9 million ($3.23). Revenue for the nine-month period rose 21 percent to $2.8 billion from $2.3 billion.