Just to share an anecdote, the last company I worked for had a nasty habit of offshoring development to the lowest bidder. The goal here was to get the software out the door as quickly as possible for the lowest cost. The mighty Project Triangle gives you the option to do any project fast, good, or cheap (choose any two) -- having exhausted two sides of the triangle, we had to sacrifice on quality.
We were selling bank software to small banks, and we were very happy when our Indian contractors were able to develop one of our huge money-making projects very quickly. As is usual, bugs were reported, and bug-fixes were fairly rapid -- usually we'd get a patched EXE within a few hours.
Things were going swimmingly for about 6 months. Without warning, the quality of our product began to nosedive: every new bug fix introduced three new bugs, outstanding bugs crept into the quadruple digits, features were taking longer and longer to developer, the application was unstable, and our customers were unhappy. It got to the point where bank presidents were calling up the president of my company in tears because our teller software was crashing 40-50 times a day which prevented tellers from doing their job. Banks were threatening to switch vendors, and the offshore contractors were unable to fix bugs fast enough. Since India couldn't do their job, we decided to do it for them: we requested access to the source code, and we laid eyes on the 130 KLOC of spaghetti code, it became immediately obvious why the application was so buggy.
We terminated our contract with India and went into crisis mode for a while -- 12 months of in-house development later, most of the original code was re-written to a slim 35 KLOC of bug-free, beautify code.
My company learned its lesson: we outsourced another major money-making project to India, but instead chose Time and Quality at the expense of cost. The accountants shared some inside knowledge with me, and I found that we paid our offshore contractors $50/hr/developer. India developed the application for 3 months to get the architecture in place, and from there we collaborated with India for the next several months to finish the product.
When I had a chance to see the code produced by our $50/hr contractors, it was very impressive, well-written, type-safe, well-documented, and used a sophisticated IoC container to handle the complex UI. The total cost to fund the project was about the same as our projections for hiring contractors in the US.
The lesson here is that "you get what you pay for." Maybe, to a lesser extent, we can take some advice from Joel who says "If it's a core business function -- do it yourself, no matter what."