NEW YORK ( TheStreet) -- Bank stocks' pain was mortgage insurers' gain on Thursday, as investors hoped foreclosure snafus might allow troubled mortgage insurers some breathing room. Shares of Ambac ( ABK), were up 8.54%, MBIA ( MBI) was higher by 12.24% and Radian Group ( RDN), PMI Group ( PMI)and MGIC Investment Corp. ( MTG)all showed big gains. The driver was foreclosure snafus by Bank of America ( BAC), JPMorgan Chase ( JPM), Wells Fargo ( WFC) and other banks. Those banks hired people who signed affidavits saying they had personally reviewed foreclosure files, when it fact they had processed far too many far too quickly to make that claim believable. Some banks, including Bank of America and JPMorgan, have agreed to halt foreclosures while they sort out the mess. Others, including Wells and Citigroup ( C), have so far resisted calls for them to do the same. But those moratoriums, as well as investigations by attorneys general in several states, could push claims that the insurers would have to be paid out this quarter to the first quarter of 2011, says Jim Ryan, a senior analyst at Morningstar. That would allow them to reinvest that money, potentially at a profit, Ryan explains. Ryan also believes the foreclosure mess could help the insurers in lawsuits against the banks where they are claiming the banks made misrepresentations on some of the mortgages the insurers covered. "This is really about survival. It would help the monolines and be better for their future. They could rebuild capital and even potentially get their ratings back," Ryan said. "The question is can they last that long." Edward Grebeck, CEO of Tempus Advisors and a New York University professor cautions investors, however. "You are basically betting on the outcome of a court case. It is not extremely clear how the bond insurers are going to come out." -- Written by Dan Freed and Maria Woehr in New York. To contact the writer of this article, click here: Maria Woehr. To follow the writer on Twitter, go to http://twitter.com/newsgirlmw. To submit a news tip, send an email to: firstname.lastname@example.org.