It neutralizes any awkwardness and kills the joke immediately.
Use humor to your advantage. nothing they say can hurt you.
Generally, though, I think a good response would include staying respectful of others and taking responsibility for your own actions. Some combination of confidence, humility, and grace.
I'd say it depends on the situation, was it a good-natured friendly ribbing or were they mocking something personal about you like your looks or something?