Sometimes a dock icon's launching the wrong app is caused by a corrupt/bloated Launch Services cache:
/Library/Caches/com.apple.LaunchServices.LocalCache.csstore
/Users/<username>/Library/Caches/com.apple.LaunchServices.UserCache.csstore
So sometimes trashing those caches helps.
Note, they also store file/application associations that you may have set in the 'Get Info' window's 'Open with' section. So when you trash the caches, you tend to lose those associations and will need to reset them.
There's also a Launch Services preferences:
/Users/<usernmae>/Library/Preferences/com.apple.LaunchServices.plist
Sometimes trashing that in addition to the above caches is needed to rectify the situtation.
Of course, there may be an issue with the Dock's preferences itself:
/Users/<usernmae>/Library/Preferences/com.apple.LaunchServices.plist
Definately rename or remove that one. If that doesn't help, you can always put it back -- if your dock's like mine, it a pain to redo it. When restoring the docks pref, you put it back in the "Preferences", then logout and back in.