First thing to try is restarting the computer. That often cures these sorts of issues.
Should that fail, check your Dashboard widgets. One of them may be crashing repeatedly, causing the Dock to crash along with it. The easiest way to do this is to navigate to ~/Library/Widgets and move everything in there to another folder, then log out and back in. (~ is your home folder.)