The popularity of pot clubs in the Bay Area has led to a burgeoning crop of medical marijuana millionaires. Call them the ganja riche. Like many of their nouveaux predecessors, they are trying to figure out what to do with their cash.

Some are giving to charity, but you will not see any fanfare or buildings named in their honor. Medicinal marijuana remains a legal gray area, and nothing — even philanthropy — is simple when it comes to the proceeds. Oakland’s medical marijuana headquarters, Oaksterdam University, could not even sponsor a local food bank.

“They refused our sponsorship because of other money they get from the federal government,” said Richard Lee, founder of Oaksterdam.

While marijuana money and munchies might sound like the perfect fit, the food bank worried that such a partnership would have put the federal dollars it receives in jeopardy.

“We appreciated the offer from Oaksterdam and gave it due consideration,” said Brian Higgins, the food bank’s spokesman. “In the end, it was not worth the risk.”

This has led to a delicate dance with financial matters, like filing taxes. Marijuana clubs and dispensaries have employees who receive W-2 forms. When it comes to filing tax forms identifying their business, it looks better if a shop is linked to a cafe or some other benign operation.

Dennis Peron, co-author of the Proposition 215 referendum that legalized medical marijuana, said that those in the business know their activities are being monitored. “Giving away money to deserving people isn’t money laundering,” Mr. Peron said.

But if the political pendulum in Washington swings to the right, a new Justice Department might not see it that way.

Neither Mr. Lee nor Mr. Peron claims to be a millionaire. But according to insiders who asked not to be identified for fear of being singled out by the authorities, medical marijuana can be a remarkably lucrative business, especially in the San Francisco region, where zoning laws severely restrict the number of marijuana clubs. There are an estimated 1,000 in Los Angeles — more dispensaries than public schools, in fact — but only about 50 in the Bay Area. Less competition means that medicinal marijuana is, for some, an especially enriching shade of green.

Those profiting from marijuana found a friend in Tim Patriarca, executive director of Maitri in San Francisco, the last hospice in California that cares solely for people dying from AIDS.

Mr. Patriarca is a true believer in the power of cannabis, seeing first hand the comfort it gives to the terminally ill in their final days. He has also seen how those donating marijuana to the hospice for compassionate care were suddenly becoming rich.

“It’s new wealth, quick wealth, and a great deal of it,” he said. “They were making money with no tradition of giving.”

Many of the newly minted marijuana millionaires, he said, came from hardscrabble lives, with little understanding of philanthropy. So he did The Ask. The ganja riche gave, and the idea grew.

It started small with $100 here and there. Then donations increased to $1,000 and $5,000. Now some clubs give as much as $20,000 in a year. The money is helping to offset the loss of more than $60,000 in state aid that Maitri received until it was eliminated during budget cuts last June.

Mr. Patriarca sees a perfect circle in operation. After all, this marijuana is supposed to be for treating illness, and now some of those profits end up directly helping the sick.

But the decision to accept the clubs’ donations was not made casually. “I knew it could be touchy,” Mr. Patriarca said. “I had to go to my board and ask, ‘Do we take this money?’ ”

Now there is a push to put a referendum to legalize marijuana on the state ballot in 2010. . Even if that happens, however, federal laws are unlikely to change. The legal status of the medical marijuana millionaires and their cash will remain as gray and transitory as a cloud from a bong wafting down Haight Street.

Scott James is an Emmy-winning television journalist and novelist who lives in San Francisco.

A version of this article appears in print on January 1, 2010, on page A23A of the National edition with the headline: Some Medical Marijuana Millionaires Are Turning to Philanthropy. Order Reprints|Today's Paper|Subscribe