Q:

How do you deal with someone who always has to one up everyone?

Have you ever met one of those people who's been everywhere and done everything and doesn't know anyone who hasn't?
Like no matter what you have to say they have to tell a bigger, better, and often longer story?
I usually chalk this behavior up to ego issues, but I don't really know how to respond to it when it starts to get a little irritating. I don't mind people who have interesting stories to tell, what gets me is the way some people feel the need to minimize other people's stories and experiences with this sort of self aggrandizing.
What's an appropriate way to get this kind of person to settle down, without shutting them down completely? 
The specific person I have in mind is otherwise a decent human being, they just have an annoying habit that I'd like to address in a mostly polite way.

A:

Like NVZ said, I usually move on from the subject as well. 
Some people get hints easier than others, at the start I would simply not give back any positive feedback to their story if it's of the 'one up' nature. 
A polite way of doing this is changing the topic once they are done to something completely different - Not another story because it might still seem to them like you're in the 1-up battle by bringing a better story to the table, but more like just general conversation.
A less polite way to handle it would be to walk away once they are done with their story, giving no positive feedback. Eventually, they'll realize that not only are they not getting the ego boost they are looking for but that they're alienating you in the process.
A more direct approach, I have had one good friend with whom I took this approach, was to be direct, say something along the lines of 

Sometimes I get the feeling that you're not listening to me when I talk, quite often I want to share a personal story with you and end up feeling as if you're only waiting for me to finish to tell your own story on the subject. 

I'm sure the intentions are not to 'one up' you, so by changing their position from a less talkative to a more attentive one might keep them on topic.
As a last resort, which I've also taken many times, simply disregard that friend as such a close friend, accept them for who they are and understand that sometimes it's not your job to change them.  
Also be wary of your surroundings, sometimes (often?) the 'one uppers' will be more of the 'one up' nature when in a crowd but behave completely different in a 1:1 conversation. 

