There's a very nice blog post about getting feedback from lost sales by Jason. In general, it always boils down to these three steps:
There have been discussion in the Open Source community about collecting feedback more effectively (IdeaStorm, Voting in the issue tracker), but you usually just reach your hardcore customers with these.
Hope this helps.
The most effective way is to just ask your lost customer, preferably in person or over the phone, why they are leaving or not buying. Have a script memorized that leads them down the path of the real reason they did not purchase. This can sometimes be an emotional ordeal, so keep your feelings in check and just ask for data. Don't try and convince them they are wrong. Rather just listen to their reasoning. By just listening and gathering data, you will learn a vast amount from a lost customer that is willing to talk.
If you have a purely on-line business, then an exit dialog might get you some feedback but those are not as effective.
Many applications open the users browser and direct them to a page which has a very small survey when they perform an uninstall. Many setup/packaging tools provide this option for your applications uninstall. The survey basically asks them why they did not like the software. Keep it very small, or you'll get few responses. If you're not good with online forms, there's many free tools to help you create them.
Lost sales (I assume your talking about existing customers who cancel their account), are doing one thing: leaving you. Just offer them a basic textbox to leave their thoughts if they want to, but don't get your hopes up. I can't think of any incentive you can give them (discounts on the competitive product they're switching to? :P)
Better start asking your existing customers what features or improvements would make your product better, and what their biggest incentive would be to switch to a competitor.