Bats, let's face it, are kind of creepy. But they're vitally important, not only to their ecosystems, but also to local economies.

There are more than 1,200 different bat species in existence, and about two-thirds of them eat insects. By chowing down on bugs, they provide free pest-control services that save farmers tons of cash — in the billions of dollars, according to one estimate — in crop damage and insecticide costs.

That's great for farmers, but also good for the bats. The services they render give people an economic incentive to protect them and their environments. There are plenty of reasons to protect a given species, such as the role it plays in a healthy ecosystem, as well as its intrinsic value as a member of Earth's colorful panoply of beasts. But if those don't warm your heart, it's hard to argue with an animal that saves humans a lot of money.

However, Mother Nature is all too prone to the forces of an open market. As supply and demand shift and new competitors emerge, the value of a species' services can decline, which means the economic argument for its conservation loses strength.

The Mexican free-tailed bat, a killer of cotton crop pests that can be found throughout the southern half of the U.S., may be particularly vulnerable to market forces. Over the last few decades, cotton prices have dropped, while the amount of land dedicated to growing it in the U.S. has shrunk. And since the mid-1990s, American cotton growers have increasingly been using Bt cotton. This variety is genetically modified to produce proteins that are toxic to certain insects, which means the plant can better protect itself. As of 2012, more than three-quarters of all U.S.-grown cotton was Bt-modified.

To see how these bats are faring in a changing marketplace, a team of researchers led by University of Arizona ecologist Laura López-Hoffman tracked the value of their pest-control services to cotton growers over an 18-year period. Using the number of insects individual bats consumed nightly, as well as the overlap between bat roosts and cotton fields, the scientists were able to estimate how much value the bats generated by reducing crop damage and insecticide costs.

The team found that over their study period, bats saved an average of 131,385 kg of cotton from damage each year, and saved growers from having to use 32,046 kg of insecticide. But the monetary value of the bats' bug-killing declined precipitously to $4.8 million in 2008, from a high of $23.9 million in 1990, thanks to falling global cotton prices, the reduction in U.S. cotton growth and, most significantly, the widespread adoption of Bt cotton.

Had Bt cotton not been introduced in 1996, the researchers said, their results would have been much different. Even at their nadir in 2008, bat pest-control services would have been worth $2.66 million dollars more if all fields were been planted with conventional cotton.

Don't count bats as out of business just yet, though. Research on five continents suggests that several major crop pests have evolved Bt resistance in the last eight years. They include cotton bollworms, a favored meal of free-tailed bats. As more insects overcome the pest-resistant plants, bats will increase in value again. Humans can come up with better, more resilient GMO crops, of course, but keeping up with and countering insect defenses requires expensive research and development — while bats do it for free.

There's more to bats than these numbers let on, too. The study only looked at one species of bat and one crop. "Mexican free-tailed bats are generalist predators and can switch diet preferences very quickly," the researchers wrote. "When cotton prices fell and farmers planted other crops instead, the bats likely provided pest-control services to those other crops — indicating that we have not fully accounted for the total value of bats' pest-control services."

And let's not forget that bats are valuable for reasons other than being flying exterminators. In the American Southwest, the free-tailed bat is a major tourist attraction. Every year, hundreds of thousands of people flock to roosts to see the bats come and go — injecting more than $6.5 million in local economies.