Maplight, a nonprofit organization that studies money in politics, has released its latest report analyzing spending in the 2012 election. The results show that, unsurprisingly, the more uncertain the outcome of a race, the more likely that the race became a magnet for outside spending from 501(c)(4)s. Here's an interactive graphic Maplight made with data from the Federal Election Commission.

Image from Maplight, using data from the Center for Responsive Politics
Image from Maplight, using data from the Federal Election Commission

According to the analysis,  501(c)(4) social welfare organizations -- outside spenders that aren't required to release the names of donors to the FEC -- spent an average of $9.1 million in Senate races that the New York Times labeled "toss-up" in 2012. Races deemed "solid" or "leaning" only drew an average of $1.4 million.

Virginia Democrat Tim Kaine beat Republican former senator George Allen for a U.S. Senate seat in 2012. (Photo by Patrick McDermott/Getty Images)

The U.S. Senate race that attracted the most money from 501(c)(4)s, according to Maplight's research, was in Virginia, where former Democratic governor Tim Kaine beat former Republican governor and former senator George Allen by 6 percentage points. The 501(c)(4)s spent a total of $21.3 million on the race. If you add up all the outside spenders who threw money at Virginia's U.S. Senate election, it tops $50 million.

The Senate race between Democrat Tammy Baldwin -- the victor -- and Republican Tommy Thompson in Wisconsin was the second-most expensive on the outside money front in 2012. There, 501(c)(4)s spent $14 million on the race. When you include super PACs, the total rises to $43 million. In both races, Crossroads GPS -- the tax-exempt nonprofit affiliated with Karl Rove's American Crossroads super PAC -- was the biggest 501(c)(4) spender in the race. Crossroads GPS spent $10.6 million in Virginia and $4.7 million in Wisconsin. Crossroads GPS has not raised much money for the current election cycle, raking in slightly over $1 million in 2013.

In 2012, 501(c)(4)s spent a total of $108.8 million on Senate races.