A quick search turned up a 2011 American Intellectual Property Law Association survey suggesting a median cost of $10k [2].
Having in house legal team to take care of it may reduce the costs but Patent Office fees still make it at least a grand to get one. If the community can chip in a few hours to crush the patent then I would think it is time well spent.
[1] http://www.uspto.gov/web/offices/ac/qs/ope/fee010114.htm [2] http://www.quora.com/Whats-the-average-cost-of-a-software-pa...
1. USA 2. The main competitor's home country
That's just for the basic filing fee. You also have to pay the search fee and the examination fee.
At Boston University they have an office of about 5 people that evaluates university generated IP to see if it is worth patenting and if their market research doesn't show that it is worth $50k over the next few years they won't bother.