The explanation below is correct. A deed in lieu of forclosure is bad but not as bad as a foreclosure. If you are considering this, make sure that you get your mortgage holder to agree that they won't come after you for any balances especially if your property is worth less than the mortgage amount of if they sell the house for less than the mortgage. you do this by having them add the terms 'without recourse' to any agreement signed by you. This is very important.
Also, any amounts owed by you to which the mortgage lender has 'forgave' you for is still taxable to you as income and they can report it to the IRS same as the balance which is left over from a credit card settlement agreement. Thankfully, Congress just passed a law that gaves people a tax break specifically dealing with mortgages due to the sub-prime melt down.
I would encourage you to talk to your lender now, they have programs that may be able to help you if you wish to stay in yor home or you can consider a short sale.