Mother Jones's Tom Philpott has shared a problem that I didn't know existed, and cannot unknow now:

You see, starting in about 2009, in the pits that capture manure under factory-scale hog farms, a gray, bubbly substance began appearing at the surface of the fecal soup. The problem is menacing: As manure breaks down, it emits toxic gases like hydrogen sulfide and flammable ones like methane, and trapping these noxious fumes under a layer of foam can lead to sudden, disastrous releases and even explosions. According to a 2012 report from the University of Minnesota, by September 2011, the foam had "caused about a half-dozen explosions in the upper Midwest…one explosion destroyed a barn on a farm in northern Iowa, killing 1,500 pigs and severely burning the worker involved."

But this is not the best description I've read of it. That comes from Pig Progress ("your portal on global pig production"):

A gelatinous goop that resembles melted brown Nerf, the foam captures gases emitted by bacteria living in manure, which on industrial farms gathers in pits beneath barns that may contain thousands of animals. 

Since it's after lunch, here's what it looks like.

Oddly enough, the problem seems to be concentrated in the midwest: Illinois, Iowa, and Minnesota, where foaming pig manure has been blowing up barns. The science is pretty simple: the foam stores the methane in the manure, and disturbing the foam (with fire, water, or "pig activity") causes a quick, explosive methane release.

But scientists don't have any idea why the manure is foaming, or why it seems to be such a problem now when it's been occasionally reported for decades.

The geographical issue seems to be more simple. North Carolina, which has many large-scale hog farms, doesn't suffer this problem, probably because of how they deal with pig manure:

Hog houses in North Carolina generally do not have deep pits, and they are much more shallow about 4 feet. Similar to the Midwestern design, the waste falls through slits in the floor into a collection pit below. But the difference is that this pit is flushed on a regular basis to an open air lagoon for long term storage. Hog operations in eastern North Carolina typically have flaps that roll up to allow for natural ventilation, preventing high concentrations of methane to build up inside the building. In the Midwest most hog operations have solid walls and are ventilated using large fans.

One theory is that "filamentous microorganisms," which cause foaming in municipal wastewater systems, are the cause—but they don't do well in anaerobic environments. Another idea suggests that the use of distillers' grains as food, which has been replacing corn and soybean as livestock feed as ethanol production has increased. But not all the farmers with foaming manure problems use distillers' grains.

While the causes are unknown—"a real CSI mystery type of thing"—there is one recommended short-term treatment: pouring antibiotics into the manure pits. In particular, an antibiotic called Rumensin, which is basically medical-grade Tums for cows.