The federal budget deficit surged to $22.9 billion in July after posting a rare surplus the previous month, the Treasury Department reported Friday.

The July deficit followed a $9.3 billion surplus in June, when quarterly income tax payments by businesses and individuals put the government's ledger books into the black.For the first 10 months of the fiscal year that began last Oct. 1, the federal deficit totaled $142.0 billion, virtually identical to the $142.9 billion deficit recorded during the same period last year.

The Reagan administration is projecting the deficit for the current fiscal year, which ends Sept. 30, at $152.3 billion. That is slightly higher than the $146.7 billion deficit estimate the administration made in February, but below the $157 billion estimate made by the Congressional Budget Office at the beginning of the year.

However, the CBO revised its figures Friday to project a $155 billion deficit for the current year. James L. Blum, acting director of the congressional agency, said stronger economic growth than expected for the first half of 1988 was responsible for the lower forecast.

Blum said the CBO is not expecting any across-the-board spending cuts to be triggered this month by a law calling for a balanced budget by 1993.

Under CBO's projections, Blum said, there is no way the budget could be balanced by 1993 in the absence of further policy changes, such as spending cuts or tax increases. The agency, in fact, projects a $121 billion deficit in 1993 if present policies are unchanged.

Better-than-expected economic growth, which has boosted government revenues and lowered government spending for such programs as unemployment benefits, has been credited with reducing the deficit this year.

Many economists believe the deficit will rise again in the 1989 fiscal year, which begins Oct. 1. The administration, however, predicts it will drop to $140.1 billion next year, when figured according to guidelines contained in the Gramm-Rudman deficit reduction law.

The July deficit, while a sharp deterioration from June's surplus, was still only 2.7 percent higher than the imbalance in July a year ago.