Many parts of the country, notably California and Texas, are experiencing intense drought. California rainfall in the Northern Sierra this year was 28.8 inches, 60% the normal amount. Most of Texas is experiencing moderate to exceptional drought conditions. Voluntary or mandatory cutbacks in residential water usage have become common.

Yet weather isn't the only problem: Government-dictated prices, coupled with restrictions on the transfer of water, have made a bad situation much worse.

Shortages are generally caused when governments place ceilings on prices or when they prevent markets from operating freely in some other way, like restricting trade. Gasoline is a case in point. Thanks to the 1970s oil shocks, gas became less abundant and prices rose. The U.S. government's response was to put ceilings on gasoline prices, which caused shortages and long lines at gas stations.

The current water situation resembles oil in the mid-1970s. Prices are determined in large part by state and federal government dictates rather than by the market. When drought hits, the price to some users, most notably agriculture, is too low to clear the market and shortages result. Ironically, in addition to eliminating shortages, allowing the market to work would result in prices that are lower than those currently paid by most residential users. Markets would encourage farmers to sell water to urban users, thereby increasing residential supply and driving residential water prices down, as the University of California's Howard Chong and David Sunding showed in a 2006 study published by the Annual Review of Environment and Resources.

The price farmers pay for water differs from that paid by urban users, sometimes dramatically. For example, San Francisco Bay Area residents obtain much of their water from the Hetch Hetchy reservoir. The pipes from Hetch Hetchy to the Bay Area intersect the California Aqueduct, which supplies water both to agriculture and urban areas. Residential users of aqueduct water in San Diego pay rates that can be more than five times as high as those paid by the farmers in Kern County.

So if some people, businesses or localities have rights to water and others would be willing to pay more for those rights, why not trade? Answer: government controls and lawsuits.

In 2012, the Public Policy Institute of California reported on the morass of regulations that continue to restrict the exporting of local water to other communities. Permits are required, which necessitate environmental studies and a lengthy assessment procedure. Statewide water transfers require approval by the State Water Resources Control Board, which also requires proof of compliance with the California Environmental Quality Act and additional proof that the transfer will not injure another legal user.

Finally, even approved transfers are subject to reversal by courts. Two months ago, the Ninth Circuit Court of Appeals ruled that the U.S. Bureau of Reclamation violated the Endangered Species Act when it failed to inform the U.S. Fish and Wildlife Service of plans to renew 41 long-term contracts with California agricultural irrigation districts that could harm the delta smelt, a fish.

To solve California's water problem, the first step is to let all owners of water sell their rights with minimal government limitations. This would ensure that water goes to its highest valued use.

Second, federal and state agencies that redirect water to environmental use should pay the market price for it. Although there may be good reasons to ensure that some fish and wildlife be protected, we should not pretend that this protection is costless. Agencies that divert water for environmental purposes should be required to budget explicitly for the lost revenue associated with the decision to divert it for this purpose, rather than allowing it to be sold at the market price for urban or agricultural use.

Third, farmers who now receive water at below-market prices should be compensated for having to pay higher prices by giving them the rights during a transition period to use or sell the water that they typically use. This would honor existing property rights and help ensure that agricultural lobbies and lawsuits do not block the transfer of water.

Rather than praying for rain, we should get the government out of the water-allocation business.

Mr. Lazear, former chairman of the President's Council of Economic Advisers (2006-09), is a professor at Stanford University's Graduate School of Business and a Hoover Institution fellow.

overlay image