PHARMACEUTICAL innovation has produced a whole new category of opioids with marvelous pain-relieving benefits. Yet these pills are highly addictive in certain circumstances and all too easy to distribute illicitly. As a result, abuse of prescription medications has become a devastating social problem in the United States, destroying lives, ravaging many rural communities and imposing billions of dollars in costs on government, employers and the health-care system. Between 1997 and 2007, the use of prescription opioids in the United States grew from 74 milligrams per person to 369 milligrams per person — an increase of 402 percent. Legitimate use alone cannot account for that surge.

A majority of states, with federal support, have helped stem the tide of abuse by enacting prescription drug monitoring programs (PDMPs). Generally, these require doctors and pharmacies to report dispensing of controlled substances to a secure central database, accessible only to authorized persons — such as doctors and pharmacists — with a need to know. The goal, and usually the effect, is to deter “doc-shopping” by addicts.

Maryland, unfortunately, was one of the few states without a PDMP; Gov. Robert L. Ehrlich Jr. (R) vetoed a bill to create one in 2006, expressing concerns that it could inhibit legitimate pain management and give law enforcement unfettered access to medical records. The lack of a PDMP possibly contributed to the fact that Oxycodone, a powerful but highly addictive pain medicine, was being prescribed at a higher rate in Maryland last year than in all but three other states, according to the Drug Enforcement Administration.

But now, Maryland’s policy is on its way to much-needed correction. This month, the General Assembly approved a PDMP bill proposed by Gov. Martin O’Malley (D). It would help deter abuse while protecting doctors from unwarranted legal liability. Under the law, which Mr. O’Malley will sign on May 10, health-care providers must report prescriptions of federally controlled substances to the state — but law enforcement can gain access to the records only with a subpoena. This is a major victory for common sense and public health, and it will increase the pressure on the last few states that do not have operational PDMPs to follow suit.

The Obama administration’s Office of National Drug Control Policy (ONDCP), which has emphasized controlling prescription drug abuse as part of its evolving strategy, deserves a share of the credit for these positive developments. But there is more to be done.

In a policy paper released Tuesday, the ONDCP recommended that physicians and dentists receive training in prescribing opioids and detecting abuse as a condition of federal authorization to prescribe controlled substances. This reform would help prevent abuse before it occurs, at modest inconvenience and cost to doctors. But it requires a change in federal law. Congress should take the necessary action as soon as possible.