Welcome and thanks for posting your query to HCM.
After reading your query it appears the possibility of "sebaceous cyst".
These are the collection of fatty and cheezy material in the oil glands which becomes larger in size. These are not painful and noticeable when these re small. But when these becomes large in size or are infected then becomes painful. IN your case there may be either of the cases as enumerated above.
It is best to consult a surgeon or a dermatologist
who can guide you best for the possibility of the cyst to be taken out by simple excision or by other method. In our experience these cyst of any kind are always to be excised and can not be treated by any medications. Do not scratch or rub the skin as it can lead to further aggravation. Hope these informations are helpful.
"Wish you good health"
Dr Sanjay Kumar Kanodia
MD (Dermatology & STDs)