As RedBadger said, posture can play a great part in causing discomfort and pain in the neck and shoulders.
Due to a shoulder problem I too suffered from time to time with a stiff neck and sore shoulder.
What helped me was to make sure that my posture was erect when running, and that I wasn't slouching. A good way to check is to consciously breath deeply as though you are breathing into your stomach and not just your chest. It's easier to do if you are running upright with a good posture. Also every few hundred metres remind yourself to relax your arms by letting them hang by your side and shake them out, this will help prevent the build up of tension.
Now to some neck exercises, I had / have an outstanding physio, he kept me running when I was doing some pretty silly distances many years ago, and I still see him for a check up from time to time.
So: stand up straight with your arms hanging loosely by your sides, imagine that your head is mounted on a rail and move it back so that your spine is as straight as you can get it without introducing tension. Lift your shoulders up towards your ears and back half a dozen times then shake the shoulders out.
Then while relaxed and trying to keep the back of your neck /back in line dip your chin slowly towards your chest and back as though you are nodding, repeat 10 times.
Return to starting position and slowly turn your head to look left until you feel a gentle stretch in the neck muscles, return to looking straight ahead and then look to your right, again until you feel a gentle stretch, repeat x 10 again.
Finally from the starting position tip your head towards your left shoulder again until you feel a gentle stretch before returning to the centre and then to the right. Repeat x 10. Finish off by shaking out the shoulders again. ( The routine is easier to remember if you think YES - N0 - MAYBE as the exercises resemble these gestures.
Do this at least twice a day, more won't hurt. Ease off if you are feeling too much discomfort, you only need to feel a slight pull as as you progress the range of movement will increase naturally.
Hope this helps