The three-hour Northern California drive from San Francisco to Nevada County passes through some of the cream of the state’s agriculture industry: dairy, alfalfa, rice, almonds, grapes. On both sides of the freeway stretch enormous crop rows, interrupted only by the state capital of Sacramento and a number of small towns.

Last fall, I made the trip north to visit a medical marijuana farm in the mountains above Grass Valley, a scenic town in the foothills of the Sierra Nevadas. The area is well suited to marijuana cultivation: The land is cheap and sparsely populated; the climate is mild.

When I arrived, I found a ragged property – a small home at the end of a rutted dirt road and a couple of rudimentary drying rooms constructed of plywood and tarps. Enclosed by a wooden fence, the farm overlooked a pristine, pine-filled valley.

The garden was impressive and unimpressive at the same time. Compared to the expensive industrial farming operations I had passed on my way up, it was tiny and unsophisticated. And yet the plants were remarkable. Many were taller than 6 feet and of extraordinary girth; they were held together by an elaborate system of plastic netting. From their limbs hung heavy, densely crystallized buds, each waiting to be dried and trimmed.

Since California voters legalized medical marijuana in 1996, and particularly since the state Legislature specified how much pot could be cultivated for medical purposes, in 2003, growing marijuana in California has become extremely lucrative. The street value of the state’s crop was roughly $14 billion in 2008. Walking through the garden, it wasn’t hard for me to see why – each pound of buds harvested from the enormous plants would fetch upwards of $3,000 at medical marijuana dispensaries.

Farms like the one I visited have helped guarantee stories about marijuana entrepreneurs. Last year it netted a healthy profit for its young bohemian proprietors, who ensured that it stayed within legal cultivation limits. During my visit, one of them told me the cliché is true: A second gold rush has hit Northern California.

But in all of the press coverage of marijuana, one story has been overlooked. It has to do with the health of California’s agriculture industry. The most bountiful farming region in the world, the Golden State is contending with three potentially catastrophic problems: population growth, dwindling water resources and climate change. Marijuana could potentially provide a bulwark against a future of steadily declining crop yields.

California is a farming utopia. Its mild climate and rich soil have allowed farmers to build on it an agricultural system of unparalleled sophistication and value. Half of America’s produce, and a large portion of its dairy, comes from California.

And yet the idyll evoked by the Golden State’s nickname, while not misplaced, conceals a dark and abiding problem. Ever since the end of the 19th century, when systematic irrigation was introduced to California, water – or, more accurately, a lack of water – has shaped the state’s agricultural history.