THE REAGAN administration has been notably lucky in most places, but not on the farm. There it has been caught between the two great prevailing traditions of American farm policy, the subsidies to encourage greater production and the subsidies to encourage less production. This year, in a desperate attempt to control subsidy costs, it gambled on the weather and lost.

That is how it happens to find itself confronted now with, simultaneously, wildly rising price support payments and rising prices. That anomaly culminates a decade of misjudgments regarding the fundamental direction of world agricultural markets. After the shortages of the early 1970s, American farm policy swung to the conviction that the world faced a chronic undersupply of basic foodstuffs. National policy encouraged farmers to expand production, and they responded on a grand scale. Farm productivity rose rapidly; agronomy continues to be among the highest and most successful of the American high technologies.

For several years, the extraordinary increases in American agricultural exports seemed to confirm the predictions. But then, as economic growth abroad slowed down, agricultural exports did the same thing. Surpluses accumulated, holding down prices. Meanwhile, the succession of bumper crops continued. 4 When the Reagan administration drew up the budget for the current fiscal year, it planned to spend less than $2 billion on farm price supports. The present estimate is $22 billion.

In a risky strategy to cut production and the surpluses, late last year the Agriculture Department proposed the payment-in-kind program: PIK. The idea was to pay farmers not to plant, and to pay them with grain out of those enormous stocks. When farmers signed up in unexpectedly large numbers, the administration cheered.

Any farm program is, to some degree, a gamble on the weather, and PIK assumed good weather. That was the bet that was lost. This summer's brutal heat and drought will mean unusually poor crops this fall and higher food prices ahead.

That leaves the administration with an interesting choice. It was clear from the beginning that PIK could serve only one season. Now the Agriculture Department has to decide how much grain the country needs to produce next year, and how best to hit that target. Too much grain means low prices, high subsidies and a heavy burden on the federal budget. Too little passes the burden directly to consumers in higher grocery prices and inflation.