This is a hair follicle
tumor that is filling with keratin proteins and distending the follicle to form a sack.
The lesion may feel like a hard pea that is moveable within the tissue. The only way to get rid of it is surgical. It is sore to touch because some of the material is leaking out of the sack and acting like a foreign substance. Go to your dermatologist who will cut it out!