I either step outside to talk to them or invite them in and apologize profusely for my house looking like hell. Usually I try some futile attempt to push things aside giving the appearance of cleanliness.
It's happened before and I just tell them to ignore all that they see, direct them to a clean portion of the house and tell them to stay there until I tidy the place up a bit. My house normally isn't too far gone and messy so all I have to do is pretty much pick up here and there.
Usually the house is a mess because we have 3 big dogs and it is chaos. I would likely not answer the door rather than be embarrassed. With cell phones, there's really no reason not to give a quick call before going to someone's home.