Stock prices took a beating during the first half hour of trading today because of bad news from the Middle East, but then staged a slow recovery for the rest of the day.

The Dow Jones Industrial Average closed at 807.45, down 1.80 points from Tuesday.

At 10:30 a.m., however, the average was 798.04 -- down 11.18 -- and had been as low as 793.60 during the first half hour of trading.

The distressing news from the Middle East -- including the attack on the Moslem mosque in Mecca and worries that the United States might use force to free the remaining 49 hostages in Iran -- also caused the dollar to weaken in Europe and the price of gold to rise.

The possibility of future oil price increases and reports that Iran might move to seal off the Strait of Hormuz in the Persian Gulf also contributed to the unease in Europe.

The dollar, however, did strengthen against the Japanese yen because of Japan's near total reliance on imported oil and reprots of a sizable Japanese trade deflicit in the first 10 days of November. The dollar closed at 247 yen, up from 215.70. The dollar would have strengthened more analysts said, head not the Bank of Japan intervened in the foreign exchange market.

The early selling on the New York Stock Exchange probably was triggered by a rash of orders from foreign investors nervous over the international news and the rising price of gold and delcining dollar, analysts said.

"But the market staged an amazing recovery," said Newton D. Zinder, chief analyst at E. F. Hutton and Co.

Nearly 37.2 million shares changed hands on the New York Stock Exchange today, up from 35 million the day before. It was the heaviest trading day in four weeks, according to Zinder. Normally the day before Thanksgiving is a light trading day.

More stocks declined in price than increased, with advances trailing declines 676 to 772.

The American Stock Exchange index was down 0.57 to 220.06.

Standard & Poor's index of 400 industrial stocks gained .23 to 11.43. S&Ps 500-stock composite rose .20 to 103.89. The NASDAQ composite index of over-the-counter trading delcined .62 to 138.88.

Ford Motor Co. was the most actived stock on the New York Exchange, with more than 1.07 million shares changing hands.

On the American Stock Exchange, Washington Post. Co, stock was the most active. The company said that it had purchased 560,000 shares of its own stock. All told, 576,000 shares of Post stock were traded.

The dollar fell sharply in Europe during morning trading, in large part because the seizure of the Mecca mosque was interpreted as a sign of political instability in Saudi Arabia, the chief yarab oil suplier to the United States.

But the dollar recovered somewhat in later trading and the volume of trading slowed dramatically. On balance, dollar trading was slim because West Germany is observing a holiday.

The dollar dropped sharply in Italy to 820.70 lire from 825.20 Tuesday. In Zurich, the dollar fell to 1.6395 francs from 1.64275; in Paris to 4.12 francs from 4.1350; in Brussels to 28.90 Belgian francs from 29.065; in Amsterdam to 1.9660 guilders from 1.97.

In London the pound rose to $2.1740 from $2.1680, and the Canadian dollar was unchanged at .8513 U.S. cents.

Gold prices closed up about $8 to $10 and ounce in London and Zurich. The final prices in Zurich were about $397.50 an ounce, up from $389 on Tuesday.