An occasional source of neck trouble is poor adjustment of a helmet, specifically, a helmet which is too far forward on the head. If the helmet is too low in front, the rider is forced to tilt the head upward to keep the helmet from blocking the view forward. Sharp backward bends in the neck can cause severe problems, so make sure that your helmet is properly fitted for your riding style.
Riders with a more aggressive riding position need to wear their helmets farther back than those who sit more upright.
Poorly fitted eyeglasses can also cause this problem. If your glasses slide down your nose you may have to tilt your head up higher to be able to be looking through, not over, the glasses.
Source: Harris Cyclery: Bycling & Pain by Sheldon Bown.