ZAPOTLANEJO, Mexico - Here in the heart of Mexico's tequila country, where every town has a distillery and the air smells sweet like fermenting molasses, a sign proudly marks the entrance to Miguel Ram�rez's farm: "Rancho Ram�rez: Producer of Agaves."

But behind the fence, the blue-agave plants, the raw ingredient of Mexico's most famous liquor, are getting harder to spot. They are being replaced by row after row of leafy cornstalks.

Like other farmers in western Mexico, Ram�rez is abandoning his slow-growing agave plants to cash in on corn, beans and other food crops that are selling for record prices worldwide.

They are part of an international trend, as everyone from Idaho potato farmers to Bolivian coca growers cut back on their trademark crops in hopes of making big money on corn and grain.

"Corn is where the money is now," Ram�rez said, admiring his new crop from the bed of a pickup truck. "I'm going to get out of agave completely."

Mexico's Tequila Regulatory Council is worried that the corn gold rush is setting the stage for a shortage that could drive up tequila prices. The effect on other crop prices is less clear.

Boom and bust

With white corn selling in Mexico for 18 cents a pound this month - its highest price in at least a decade - compared with as little as 2 cents for agave, the switch was probably inevitable, said Mart�n S�nchez, director of agriculture for the tequila council.

"We don't have good numbers, but we know it is happening: People are abandoning their fields of agave and flipping over to other crops," S�nchez said.

In many fields east of Guadalajara, overripe agave plants are turning brown and dropping their spikes.

Prices are so low that the crop is not worth harvesting, said Antonio Aceves, a farmer in the town of Tototl�n who cut his agave acreage this year to 25 from 74. Harvesting of agave is labor-intensive and would cost more than what he could earn from sales.

Aceves said the seeds of uncertainty in the agave market were sown in 1997, when a frost killed millions of young plants. By 2002, agave prices had risen to a stunning 80 cents a pound. Jos� Cuervo, Sauza, Herradura and other distillers were paying up to $100 for a single "pineapple," or agave heart.

"You practically had to guard your field with an army," Aceves said. "A lot of people got rich, and suddenly, everybody was planting agave."

The big tequila makers, meanwhile, became determined to avoid another shortage. They began growing agave themselves on rented land and contracted with hard-nosed brokers to cover any shortfall, said Rafael Aldana, an officer of the farmers' co-op in the town of El Arenal.

An agave plant takes five to seven years to mature, so farmers are now facing a glut of agave and no buyers. About 25 of Aldana's 35 acres of agave are ripe for the picking, he said.

"Nobody wants them," he said. "I'll probably lose them all."

Switching over

In a field near the town of Tequila, farmhand Raudel L�pez Sandoval navigated past the needle-sharp spines of an agave and stabbed the dirt with a pole. He grabbed some beans from a plastic container on his waist and tossed them into the hole.

"Beans grow fast," he said. "You tend an agave for six years, and then the price drops on you or you get hit with a freeze or something. It's a lot of investment to lose."

The price of beans in Mexico has risen 60 percent since December, to 59 cents a pound from 37 cents. Corn, Mexico's other staple food, is up 24 percent, to 18 cents a pound.

At his feed store in Tototl�n, Guadalupe Salorio said sales of corn seed went up 20 percent this spring as agave farmers switched crops.

The rise in the price of food crops is an international trend as developing countries such as China and India begin to eat better, high oil prices raise the cost of fertilizer, and the United States and Europe divert corn and vegetable oils into refineries aimed at making alternative fuels.

As of June, world food costs had risen 62 percent since early 2006, according to Oxford Economic Forecasting, a British consulting firm. The worldwide price of cereals such as corn and wheat was up 120 percent.

Idaho potato farmers reduced their potato acreage by 10 percent this year in favor of corn, barley and wheat. Indian cotton growers have planted 18 percent less than they did last year to make room for food crops.

In the American South, cotton planting was the lowest since 1983 as farmers switched to corn and soybeans, according to U.S. Department of Agriculture statistics.

In Bolivia, President Evo Morales, who long championed the growing of coca leaf for non-drug uses, is now urging coca growers to supplement their crops with rice and corn to help feed the Andean country. The Chapare region's union of coca growers is requiring each of its 35,000 members to plant 2�1/2 acres of rice.

Corn prices were expected to ease slightly in the United States because of a bumper crop this year. Nevertheless, the bonanza has accelerated a global trend toward raising fewer types of crops, putting the world's food supply at greater risk in case of a disease or disaster, said Doreen Stabinsky, an agriculture expert at Greenpeace.

"It's a whole problem of mentality, where you have millions of acres focused on producing just a few crops," Stabinsky said. "It's been highly detrimental to crop diversity."

A bounce back?

Tequila officials, meanwhile, believe there could be an agave shortage on the horizon, S�nchez said.

"When the price of agave is low, people get demoralized and abandon their crops," he said. "There's often a lack of good long-term planning."

During the last agave shortage, in 2001-02, makers of some premium tequilas raised prices by a few dollars a bottle. Others began adding other types of alcohol to their products to stretch supplies. Tequila has to contain only 51 percent of pure agave to carry the name.

Distillers already are preparing for leaner days by stockpiling finished tequila, he said. And some growers have stopped weeding and spraying their older agave plants, devoting their attention to younger plants in hopes that the price will bounce back.

Rafael Murillo is one of the optimists. On a hill outside Tequila, he used a sickle to whack away at weeds around some 3-year-old agave plants, their blue spines now thigh-high.

"The mature agaves are a lost cause," Murillo said. "But I'm not going to become a corn farmer yet. These little ones still have a future."

Reach the reporter at chris .hawley@arizonarepublic.com.