By FERNANDA SANTOS

SCOTTSDALE, Ariz. — Soon after health officials announced that they would dole out Arizona's first licenses for medical marijuana dispensaries, Ryan Hurley, co-chairman of the medical marijuana practice at the Rose Law Group here, noticed a common trait among some of the people most eager to enlist his services: They were in the business in other states.

There was a family who owns dispensaries in Washington state. There was an investor from Los Angeles who has a stake in several California dispensaries. There was a disabled Navy veteran who makes a living running a medical marijuana delivery service in San Diego.

Arizona has one of the country's strictest set of requirements governing the sale of medical marijuana — and, Hurley said, they were all looking to tap into its market because of that.

"There's a sense of legitimacy that comes from having so many rules," he said.

Medical marijuana programs exist in a gray area. They are legal in 17 states and the District of Columbia, but illegal under federal law, where selling and consuming marijuana, even if for therapeutic purposes, is still a crime. It is a risky undertaking: In California, where rules governing the business are particularly lax, medical marijuana ventures have been targets of raids.

In Arizona, it is a costly and cumbersome enterprise.

Dispensaries have to abide by zoning regulations that change from one municipality to the next. Applicants must offer detailed plans on how to secure, store and track the marijuana they hope to sell. They have to offer educational materials, which is standard practice, and hire a medical director to supervise the operation, the only requirement of its kind in the country.

"A physician can get involved in how it's being used as medicine on a day-to-day basis, and that's the big kicker here. If you're going to use cannabis as medicine, you've got to be able to understand the science and also apply the science," said Michael Backes, director of research and development for Abatin, a consultant to three dispensaries in California that have applied to open two more in Arizona.

There is a limit to the number of dispensary licenses the state will give out in this first phase: 126, one for each of the geographic regions carved out by health officials. For the state, it prevents the marijuana business from becoming too expansive, as happened in California and Colorado, before Colorado legislators passed laws to control it. California is still struggling to tighten its rules.

Rules on inventory control were inspired by those in Colorado, and a requirement that doctors analyze 12 months' worth of medical records before certifying a patient for medical marijuana use was borrowed from New Jersey.

Then there were things they learned from the public, through official and surreptitious means. Will Humble, director of the Arizona Health Services Department, said his staff used a fake Facebook page to monitor the conversation about the state's medical marijuana program, which is how they got to hear about loopholes they never knew existed.

For example, the state gives preference to people who have $150,000 or more in cash for each dispensary application they file; a bank statement would have sufficed as proof the money was there. But people suggested they would just transfer the money from one bank to another, then use the statements to support different applications.

The state went on to ask applicants to prove the money had been in the bank for at least 30 days, Humble said.

"There was a fork on the road, really, and to the left would be California, where it's a free for all, where you have a medical marijuana program that's really a recreational marijuana program," he said. "We said, look, let's go to the opposite direction and let's try to do it right."

Humble is, by his own admission, the reluctant leader of a program some say could serve as a model for the country, particularly because of its emphasis on medical supervision. He joined Gov. Jan Brewer in a lawsuit last year, asking federal courts to address the conflict between state and federal laws regarding medical marijuana, but the courts dismissed it.

The lawsuit followed a threatening letter from the U.S. attorney's office in Arizona, saying that "growing, distributing and possessing marijuana in any capacity" is a violation of federal law, "regardless of state laws that purport to permit such activities."

A 2011 letter from the Justice Department made a similar point.

For two weeks in May, the state accepted its first applications for dispensary licenses; 484 of them were submitted. Humble's office built a computerized program, where patients will have to swipe magnetic cards every time they buy marijuana to make sure they do not exceed the maximum allowance of 2.5 ounces every two weeks. Growers must keep records of how much they are growing; delivery trips would generate a record like a moving company's bill of lading, listing exactly how much was transported and where.

Humble said the medical directors would make it less likely that dispensaries would "devolve into the type of place where you just come in and get stuff to get stoned."

Still, he went on, "I don't want to make it sound like it's a perfect system, that it's going to be 100 percent medical, because I know it ain't."

(STORY CAN END HERE. OPTIONAL MATERIAL FOLLOWS.)

Douglas McCrady, who has multiple sclerosis and uses marijuana to treat its symptoms, said he moved to delivering marijuana in San Diego after being served with eviction notices twice at his dispensaries, both times after federal authorities sent letters to landlords directing them to crack down on "drug-dealing tenants," he said.

He went on, "I was paying taxes, I was trying my best to be legitimate. I served in the Navy, I have no criminal record. Maybe in Arizona I'll finally be recognized as a business."

Of the 126 dispensary locations made available by the state, 27 — most of them in Indian country and rural areas — did not receive any applications. Several spots had multiple applicants; Flagstaff, in northern Arizona, received 13 applications.

Winners will be picked in August, by lottery if there is more than one person vying for the same spot.