In my experience Option B above only occurs when leaving a lousy work place. I've done the same thing twice.
But after about 2 years of not making money at the "great place to work" I end up having to move on to something that is also interesting, but actually pays.
But then again, I never accept a counter offer. If I was worth 15k more to you, then why the hell weren't you paying that to start with? That just shows a lack of respect.
Absolutely don't accept counter offers. The main reason they are offered is so that the company can have you leave on their schedule, not yours. Even if this isn't their agenda, you've created a poisoned atmosphere which will make something you're unhappy with be even worse.
In terms of great programmers, money is often subordinate to a great many other things, hence adjunct. Note I didn't say money doesn't matter.
Let me illustrate by paraphrasing the conversations I have on occasion.