IN AN IDEAL world, doctors would combine excellence of care with cost-effectiveness. Unfortunately, the U.S. health system is wildly expensive compared with those of other rich nations. In a second-best world, doctors would deliver treatment that prices some people out of the market but that's great for the majority. On the whole, the U.S. system meets that standard. But in a really not-at-all-good world, doctors would be driven neither by cost-effectiveness nor by medical ideals. Unfortunately, bits of the health system do behave that way, because financial incentives push in a perverse direction.

Consider a loophole that may open soon with the expiration of a ban on Medicare and Medicaid payments to new specialty hospitals. There's nothing wrong in principle with small clinics that focus on one or two procedures; it's possible that specialization boosts quality and efficiency. But there is a lot wrong about the fact that specialty hospitals are often owned by the doctors who refer patients to them. The conflict of interest is obvious: If a patient accepts the doctor's advice to undergo back surgery, for example, the doctor may profit as the surgeon who performs the procedure, as an executive of the hospital at which it is performed and as a shareholder entitled to a chunk of the hospital's profits. These incentives are likely to cause doctors to recommend surgery more than they would otherwise -- in particular, to patients who might have recovered, at less cost and with less medical risk, with a few weeks of physical therapy.

Federal law bars hospitals from rewarding doctors who refer Medicare and Medicaid patients to them, recognizing the danger of a conflict of interest. But at the time the law was written, doctor-owned specialty hospitals had barely emerged, so they're not covered by the legislation. Today about 100 specialty hospitals have been established across the country, concentrated in states that have loose rules on opening hospitals. Maryland, Virginia and the District have been spared this epidemic because of tougher regulations. The specialty hospitals have proved wildly profitable for the physicians who own them, so many more are likely to spring up unless regulators block them.

The consequences go beyond unnecessary operations. Because doctors refer only the simpler -- and therefore more profitable -- cases to their own hospitals, they leave full-service community hospitals with cases that often cost more to treat than the reimbursement offered by Medicare. This can threaten the viability of hospitals on which sicker and poorer patients depend. Traditional hospitals serve a higher proportion of Medicaid patients and racial minorities than the profitable specialty upstarts. The specialist hospitals have no emergency rooms, thereby eliminating the opening through which uninsured patients gain access to hospital services.

Two years ago Congress imposed a moratorium on Medicare payments to new specialty hospitals because of these concerns. That ban ran out in June, though the administration has announced measures that extend it until January. The government's Medicare Payment Advisory Commission has recommended yet a further extension until January 2007, but a permanent solution is needed. Sens. Charles E. Grassley (Iowa) and Max Baucus (Mont.), the top Republican and Democrat on the Senate Finance Committee, have proposed a measure that would ban doctors from referring Medicare and Medicaid patients to most specialized hospitals in which they have a financial stake. This common-sensical idea should become law quickly.