If you are struggling to pay your mortgage and have not yet entered foreclosure, the best thing to do is to call your lender and notify them of your difficulties.
There is no need for a long sob story -- just the facts will do.
Remember: foreclosure is a difficult and expensive proposition for mortgage lenders and they want to avoid it just as much as you do. Often, they'll help you craft a payment plan to get current on your loan(s) -- but they have to hear from you first!
Anything you can do to preserve your credit rating serves you well in other areas of your financial world including credit card interest rates, auto loans, and insurance payments.
Bad situations happen to people who otherwise have good credit all the time. Don't let a temporary problem destroy your credit or threaten your home.
No one benefits from drastic action taken against you, so give the lender a call and work things out to everyone's satisfaction.