I think this is helpfull.
Hi!
Severe scalp pain at the back of the head is in all probability due to pinched cervical spinal nerves. When you have the intense pain, you can ask someone to massage your upper back and neck. Also after taking a pain killer you can do gentle neck exercises. The pain may be coming if you are doing something that strains your neck (doing fine work or working at computer etc). So, if you do such jobs, do simple neck exercises in between to remove the strain from neck.
If the symptoms recur, please consult your doctor regarding this. Hope this helps. Take care!
The medical advice given should not be considered a substitute for medical care provided by a doctor who can examine you. The advice may not be completely correct for you as the doctor cannot examine you and does not know your complete medical history. Hence this reply to your post should only be considered as a guiding line and you must consult your doctor at the earliest for your medical problem.