Updated from May 18

Applied Materials

(AMAT) - Get Report

swung solidly into the black in its fiscal second quarter, exceeding Wall Street's expectations for the second quarter in a row.

Applied's stock was recently up 29 cents, or 1.5%, to $19.14. Despite the company's standout report and the stock's gains, UBS downgraded its recommendation on AMAT to neutral from buy Wednesday morning. (UBS simultaneously downgraded several other chip equipment makers, including

Novellus

(NVLS)

and

Veeco Instruments

(VECO) - Get Report

.)

After the close Tuesday, Applied Materials posted earnings of $373.35 million, or 22 cents a share, in its quarter ended May 2. In the year-ago period, the company lost $62.13 million, or 4 cents a share.

"Investment in 300

millimeter semiconductor equipment for leading-edge technology, combined with capacity purchases of our 200

millimeter systems, drove Applied Materials' strong revenue and order growth this quarter," the company said in a press release.

Applied's sales jumped 82% from the second quarter last year to $2.02 billion.

Analysts surveyed by Thomson First Call were expecting the company to earn 19 cents a share on revenue of $1.89 billion. The company had

forecast that it would earn between 17 cents and 19 cents a share on about $1.87 billion in sales.

The company's prospects may continue to improve. In the second quarter, Applied recorded $2.21 billion in orders, up 32% from the amount recorded for the first quarter and 128% for the same period a year ago.

Meanwhile, the company offered third-quarter guidance that was slightly above analysts' expectations. Applied expects to earn 23 cents to 25 cents a share on sales of about $2.12 billion, representing a 5% sequential increase in revenues.

Wall Street has predicted that the company will earn 23 cents a share in its current quarter on $2.11 billion in sales. For the year, analysts expect the company to post a profit of 80 cents a share on revenue of $7.82 billion.

Applied showed strong gains not only on the revenue side of its balance sheet but on its cost containment as well. The company's gross margin -- which represents the difference between what a company charges customers for its products and its direct costs of producing those products -- jumped to 46.5% of sales, up from 43.5% in the first quarter and 33.7% in the year-ago period.

At the same time, Applied's operating costs fell 13% to $423.61 million. As a portion of sales, such costs dropped to 21.0% from 44.0% a year ago.

Part of the difference in operating costs was a $92.7 million restructuring charge the company took in the second quarter last year. But on a conference call, company CFO Joe Bronson said that the restructuring had saved Applied millions of dollars.