While most hospitals across the country are looking for creative ways to fill surplus beds, hospitals in New York City are so overcrowded they're turning ambulances away and patients are lying in emergency rooms for hours, and even days, waiting for beds to open up.

Some experts are blaming the AIDS epidemic for the situation, but others say that AIDS alone doesn't explain the unexpected shortage.

"We're experiencing what one physician refers to as 'patient gridlock,' " said Kenneth Raske, president of the Greater New York Hospital Association. "Beds are full. Emergency rooms are turned into holding rooms. The whole system is getting jammed up from top to bottom."

Critically high occupancy levels are occurring at "virtually every hospital in every borough," according to a spokeswoman for the United Hospital Fund of New York, a nonprofit research organization that is studying the situation. So far the problem appears to be unique to New York City, she said, although southern Westchester County also is beginning to be affected.

"Almost every emergency room in the city is on diversion," forced to send ambulances to other less crowded hospitals on the city's 911 emergency system, said Charles Meyer, president of Brookdale Hospital Medical Center in Brooklyn. "When everyone is on diversion, no one is on diversion," since crowded hospitals in essence would be sending ambulances to one another.

Meyer said his 800-bed hospital is so full that one day this month, 31 patients were in the emergency room waiting to be admitted. Some hospitals in the city have begun serving meals routinely to patients waiting in emergency rooms.

Last July, according to Greater New York Hospital Association surveys, the occupancy rate in New York City hospitals was roughly 82 percent. By December, it had climbed to at least 90 percent for most of the city's hospitals, and 95 percent or higher at city-run hospitals -- levels considered full or near full.

By comparison, occupancy rates at hospitals in the Washington metropolitan area have been stable at about 80 percent, according to the Hospital Council of the National Capital Area. Nationwide, the typical occupancy level is 65 percent.

Hospital officials in New York are at a loss to explain the dramatic and unexpected rise in the number of hospitalizations since last summer.

Many people, including the state health commissioner, attribute the problem primarily to the rapidly growing number of AIDS patients. At least half of new York's estimated 200,000 intravenous drug users are thought to be infected with the AIDS virus, according to a report in The New England Journal of Medicine.

But the United Hospital Fund said that despite a 25 percent increase in the average daily number of AIDS patients in the hospital over the last eight months -- from 1,071 to 1,335 -- the number of AIDS patients still only makes up 5 percent of the city's total patient population.

Emily Goodwin, research director for the United Hospital Fund, said that while the impact of AIDS is "enormous and growing dramatically," admissions of other types of patients have also increased. The report by her group noted, for example, that even pediatrics and psychiatry -- as well as medical-surgical services -- are experiencing a marked increase in demand for in-patient care.

At the end of 1986, the city's 90 hospitals closed about 1,200 beds, or 4 percent of total capacity, as part of a cost-containment effort. In addition, city officials say, a shortage of nursing homes and long-term care facilities has caused many elderly patients to remain hospitalized longer than necessary because they have no means of alternative care.

Meanwhile, the state has devised an emergency plan to add about 500 hospital beds in the next few weeks. In view of the nationwide nursing shortage, however, the city could have a problem staffing them, noted Raske of the state hospital association.