The Democrat candidate successfully sued to have several ballots invalidated in the Jore race in 2004, and in a fact not widely known, the only way she could do it was to personally sue Jore himself. Montana law also allowed for the winner of the challenge to sue the loser of the challenge for court and legal costs (which in this case amounts to about $18,000 -- a lot of money.)
This is indeed a crazy law, since Jore wasn't the one marking the ballots or deciding which votes were valid. Sen. John Cobb, R-Augusta, has proposed a bill to change this unfair law by having the state pay the bill. The Secretary of State's office (from whom the money would come) understandably wants a different solution, namely to have the one filing the suit pay for legal costs regardless of the outcome. The Secretary of State has a good point, since the state could be on the hook for any such suit, regardless of its merit.
A combination of the two would probably also work: if the challenger wins, the state pays, since a court has decided that the officials counting the ballots did it wrong; but losing challengers should pay the legal bill, since the burden of proof is really on them.