Medical marijuana has been legal in California since 1996, but its dispensaries and their proprietors have periodically faced crackdowns from federal authorities who do not recognize the state law, which was passed as Proposition 215. Supporters of the drug’s medical use have been cheered, however, by recent remarks from Attorney General Eric H. Holder Jr. that those abiding by state law will not be made a target by federal agents.

California, whose $26 billion budget crisis has dispirited many residents, has toyed with the idea of legalizing marijuana, with a bill that would legalize and tax the drug scheduled to be taken up by the Assembly later this year. The dispensaries already pay some $18 million a year in state sales tax, according to the Board of Equalization.

Laura Thomas, deputy state director for the Drug Policy Alliance in San Francisco, which lobbies for changes in drug policy, said the recession was forcing many states to consider “untouchable topics” as potential revenue streams. “In hard budget times people are willing to be more creative,” Ms. Thomas said.

In Oakland, Measure F raises the tax on “gross receipts” at a handful of dispensaries to $18 per $1,000 worth of goods sold, and is expected to raise about $300,000 in new taxes. That is not much money  the city just closed an $83 million budget gap  but even so, a spokesman for Mayor Ron Dellums said the mayor was grateful for “all measures that will help with our budget situation.”

For Mr. Lee, who plans to introduce a ballot measure this week  with an eye toward getting it on the ballot in 2010  seeking to legalize personal, nonmedical use of the drug, the election victory means he would pay about $42,000 more in taxes. Not that he minds.