THINGS ARE LOOKING up a bit for the farmers. You will remember the farmers' protests against low prices last winter, and the threats of a strike. Congress responded in May with an emergency farm bill. Now, five months later, the prices of most farm products have risen sharply - for reasons, incidentally, that are totally unrelated to the emergency bill. Net farm income last year was a little over $20 billion.This year it will be $25 billion or more, the best in four years.

Meanwhile, at the supermarket, from January through August food prices for consumers rose at the exceedingly brisk rate of 24 percent a year. This time there was little widening of margins. Most of the increase was directly due to higher prices to the producers. There's no great mystery about the reasons for these higher prices at the farm. But they illustrate the limits on a government's ability to set agricultural prices with any degree of accuracy from year to year.

The surge in beef prices, for example, is the aftermath of the famous Russian wheat sale and the grain export boom that started six years ago. It sent grain prices to unprecedented levels, and the cattlemen, buying feed for their animals, and the cattlemen, buying feed for their animals, took heavy losses. They responded by thinning out their herds as fast as they dared, sending animals to slaughter in numbers that kept the market depressed for several years. That thinning process ended last winter and, for the people who raise beef cattle, it was suddenly a sellers' market again. Wholesale prices have risen almost a third over the past year, but the cattlemen point out that they have only begun to recoup their previous losses.

As for the grain producers, last winter they were once again, in the classic pattern, the victims of their own productivity. A succession of huge harvests had pushed prices far down, while inflation was sending the farmers' production costs up. Congress had set up a system of reserves to absorb some of the surplus, but the farmers didn't trust it to do much for them.

They were wrong, as it turned out, and the reserves are indeed working effectively to take some of that grain off the market. But while that has been happening, there's also been another unexpected rise in foreign bidding for American foodstuffs. The Soviet Union and China have both been buying heavily, but it's more widespread than that. Foreign customers are generally taking more than anticipated. Why? One explanation is the decline of the dollar, which makes American farm products cheaper abroad. The price of wheat has risen by a third since last fall. Even the price of corn is up, although the corn crop now being harvested will probably be a record.

It's been a pretty good year for farmers, on the whole - but the rise in farm prices is the biggest single reason for this year's acceleration of inflation. That brings the Carter administration to an interesting decision. Prices next year are going to be affected by a lot of things like weather, foreign demand and the acreage of land planted. Of all those factors, the only one that the Agriculture Department can influence directly is the size of the plantings. By mid-November, at the latest, it must tell famers how much land to set aside next year. If it chooses a low figure, it risks crops big enough to swamp the market again and send farmers' incomes dangerously low. But if it sets large set-asides, the risks shift to higher prices and further inflation. The department hasn't yet made up its mind about numbers. But if you are looking for clues regarding its inclinations, you might find one in its decision to announce the set-asides this month - which is to say, before the November elections.