Montana isn't often considered a fiscal policy pioneer, but in 2003 lawmakers closed a corporate tax loophole that was costing the state millions of dollars in lost revenue. A decade later, other cash-strapped states are finally following Montana's lead.

This past July, Oregon became just the second state to eliminate what is known as the "water's edge" loophole, which lets some companies lower their tax bill by hiding profits in places like Bermuda and the Cayman Islands. Oregon estimates the measure will generate $17 million in new revenue this year. Montana has raised about $40 million since it changed the law -- a lot of money for a state with a small budget. A handful of other states, including Minnesota, Maine and Illinois, are considering similar action.

This push is happening even as federal efforts to shut down corporate tax havens, a stated priority of the Obama administration, seem increasingly remote. Sen. Carl Levin, a Michigan Democrat, introduced legislation last year that would essentially close the same federal loophole the states are targeting, among other reforms, but that bill is mired in the same partisan muck that has encased the rest of Washington.

Corporate tax avoidance is both pervasive and massively costly. According to a 2013 report from the U.S. Public Interest Research Group, a consumer advocacy organization, 83 of the nation's 100 largest publicly traded companies use tax havens to avoid paying an estimated $150 billion each year. The water's edge loophole costs 22 states with tax codes similar to Montana's about $1 billion each year, U.S. PIRG calculated in a report released Jan. 30.

Tax reform advocates who are behind the state-level push say they hope the example set by Montana, and now Oregon, will spur other states to step up.

"States don't need to sit on their hands and wait for federal action to close tax haven loopholes," said Dan Smith, tax and budget advocate at U.S. PIRG.

The big fish is California, which would save nearly a quarter of a billion dollars if it were to act, according to U.S. PIRG data.

The water's edge loophole is made possible by what otherwise seems a sound financial policy. Most states allow U.S. companies to lower their tax bills by excluding profits earned abroad, so they aren't paying taxes on the same dollar twice. But over the years, sophisticated accounting and tax departments have figured out how to use the water's edge loophole to avoid paying any taxes at all on some profits.

Under one typical method, used especially by pharmaceutical companies, a business transfers a patent on a drug to a phantom subsidiary set up offshore in a country that does not collect corporate taxes. Then, each time that company makes a sale domestically, it pays a royalty fee to that offshore subsidiary. In doing so, it artificially reduces profits.

Schemes like this can have the effect of dramatically reducing -- or even eliminating -- a company's domestic tax burden.

Montana's solution was to create a list of more than a dozen known tax havens. Since 2003, companies that reported profits in countries on this list have been required to include that money when determining their state tax bill.

Montana and Oregon will not disclose what companies were using such techniques to avoid paying state taxes. According to a 2008 report from Montana tax authorities, 26 companies were forced to pay higher taxes because the loophole was eliminated.

At the federal level, practically every major U.S. company makes use of offshore havens to lower its tax bill, including household names like General Electric, Apple and Google. So far, powerful lobbyists for these interests have successfully held back reform, but the calculus at the state level is different.

Interviews with authorities in Oregon and Montana revealed a spirit of bipartisan support for corporate tax reform that simply isn't imaginable in Washington.

The Montana law was introduced by a Democrat, approved by a Republican-controlled legislature and signed into law by a Republican governor. The state's business community was also largely on board.

"Small business owners regardless of their politics thought it was unfair," said Dan Bucks, a former Montana revenue director.

Oregon's experience was the same, said Peter Buckley, an Oregon Democratic state representative who co-sponsored the measure. Supporting the bill became "a matter of down-home pride," he said.