It sounds like an infected sebaceous cyst. You are having this pain because it is pressing on the nerves supplying the area. They may occur anywhere on body but scalp, ears, back, face, and upper arm, are common sites for sebaceous cysts. Blocked sebaceous glands, swollen hair follicles and excessive testosterone production will cause such cysts.
Generally no treatment is required but they become painful then it means they are infected, then surgical excision by traditional wide excision, minimal excision, and punch biopsy excision may be required.
I hope it helps. Take care and please do keep me posted in case you have any additional doubts. Kind regards.