In the 1990s, well-meaning physicians changed the way they prescribed narcotics after medical researchers determined that pain was being undertreated in the United States.

As a result, large quantities of powerful drugs like OxyContin were diverted into the black market. Drug makers, pharmacists and doctors got smarter about how they distributed the drugs, but not before people abused them and became addicted, in many cases leaving their lives ruined or their families grieving.

Maine will face a similar danger with the opening of medical marijuana dispensaries next year, the first six of which will be run by three licensees, named Friday by the Department of Health and Human Services.

The Cumberland County Clinic is to be set up in a former bank on Congress Street in Portland, with access to public transportation and located near hospitals and medical offices, but far enough from schools.

The license will be held by a California-based firm, Northeast Patients Group, a nonprofit that will also run three other dispensaries shared by Kennebec and Somerset counties, four midcoast counties and Penobscot and Piscataquis counties.

Reports of how medical marijuana is distributed in California make the group’s presence here unsettling. On the West Coast, medical marijuana is seen by many as a legal fig leaf for recreational drug use, allowing “clinics” equipped with on-site doctors who can write prescriptions for “anxiety” to any “patient” who wants one.

Maine’s rules about how prescriptions are written and for what conditions are much stricter than California’s, and if they are rigorously followed, Maine’s dispensaries have a better chance of getting marijuana to those who are supposed to have it.

We are encouraged that Northeast Patients Group has named Cumberland County Sheriff Mark Dion to its board of directors. Dion was an early advocate of medical marijuana, but a vocal opponent of general legalization. He will bring a law-enforcement perspective that should be valuable in determining the safest ways to distribute the drug.

We don’t need another drug diversion disaster. It’s up to the state and these licensees to make sure it doesn’t happen again.