Why does my Mac's list of "Open with" applications start listing the apps twice and sometimes three times? When I right-click on a file on my Mac OS desktop and then in the contextual menu, I move to the "Open with...", the list of potential applications to "open with" has applications listed multiple times, sometimes three or four times, right next to each other!


Why does this happen?
How do I fix it?
how do I stop it from re-occurring?


See this snapshot of the contextual menu showing the doubling up:

 

Now I have Mountain Lion on a 13" MacBook Pro, but this problem existed before I upgraded to Mountain Lion.
This happens because the LaunchServices database gets corrupted. 

To fix on Mountain Lion:


Open Terminal.app in the /Applications/Utilities/ folder.
run /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain system -domain user
Restart


This command has changed over the years, but I just recently ran the above to fix the same issue on Mountain Lion. This hint on Mac OS X Hints covers the command for other Mac OS versions over the years.

If you don't like using the command line, the free tool Onyx also has an option under Maintenance -> Rebuild -> launchservices will work too. 

As for how to stop it, I really haven't ever seen a way. I am not sure what actually causes it to corrupt other than I know it is very actively used.