This is more of a workaround than a solution; I have the same problem occasionally. If you open the dock properties, go to the Positioning tab, and uncheck & re-check the "show dock as drawer" check box; you'll be all set.
This is an annoying problem, and it only happens occasionally with me, but this always fixes it.