You should spurn it. When once you decide to quit, your loyalty becomes questionable. The surprise offer is to meet the dead lines and complete the projects you are handling. If you accept the offer, you become cheap in the eyes of your colleagues who know that you have been given the hike not on merit basis but because of your threat that disturbs the schedule.
When your loyalty and dedication to work are in question, you will not be considered for promotions down the line and as such your career path is blocked. You will be the first victim of any staff pruning or layoffs. After they get what they want from you, the employer will show you the door at the earliest opportunity and it becomes very difficult for you to get a suitable job when you are jobless.
The counter offer is just a short-term fix to solve a problem that suddenly has popped up. So, on all counts you should not hesitate to spurn it.
You should see why you have thought about looking for a job. Just because you have been offered pay hike, the work environs and people around you don't change. Many professionals who had counter offers eventually leave the company because the issues that caused dissatisfaction had not been resolved. It may be stressful to work in a new company and new colleagues, but it is necessary for career development, especially when you are looking for new challenges or increased job satisfaction. You would not have accepted the new job if you have not realized that the new environs are a better fit for your professional development. The counter offer doesn't change this scenario.
When you evaluate the counter offer you should know that your reputation is at stake. If you decide to stay back, you will not only lose trust your present employer had in you, but also you will lose your credibility with new employer. Besides all this, your professional reputation is the most important attribute on which your marketability and career success depend. Whatever the hike or promotion it is, no one can put a price on one's reputation.
Many who face counter offer dilemma might not have exhausted avenues for remedying their dissatisfaction. Talk to your manager first and bring to his notice what you have contributed to the wellbeing of the company and how your salary is comparatively low. If the issue is of job satisfaction, seek more responsibilities or ask for more challenging assignments and see how you will get them in the present company.
If you are repeatedly reaching a dead end, seek a change and never retract from the decision to quit.