What is an annuity, and is it a good investment?

Why would someone choose to take their retirement money as an annuity instead of taking it all at once when they retire?