Despite efforts by the Obama administration to ease shortages of critical drugs, shortfalls have persisted, forcing doctors to resort to rationing in some cases or to scramble for alternatives, a government watchdog agency said on Monday. The number of annual drug shortages — both new and continuing ones — nearly tripled from 2007 to 2012.

In recent years, drug shortages have become an all but permanent part of the American medical landscape. The most common ones are for generic versions of sterile injectable drugs, partly because factories that make them are aging and prone to quality problems, causing temporary closings of production lines or even entire factories.

The analysis by the United States Government Accountability Office, released Monday, was required by a 2012 law that gave the Food and Drug Administration more power to manage shortages. The watchdog agency was designated to evaluate whether the F.D.A. had improved its response to the problem, among other things.

The accountability office concluded that the F.D.A. was preventing many more shortages now than in the past — 154 potential shortages in 2012 compared with just 35 in 2010 — but that the total number of shortages has continued to grow. In 2012, the number of drugs in short supply, both new and long-term, was 456, the report said, up from 154 in 2007. Such drugs now include the heart medicine nitroglycerin, and cisatracurium, which is used to paralyze muscles during surgery and for patients on ventilators.