From your description sounds as though you may have what's called sebaceous cyst. If there is pain with it, then it may be a boil. Either one, apply a warm compress to the area several time a day to help draw it out and open. Don't try to squeeze this, it can cause further infection. If you get more or you don't get it to drain, then you should see your doctor so he can drain it properly.
Then if it's hard and painful then it's a boil, also referred to as a skin abscess, is a localized infection deep in the skin.
Apply the warm wet compress several times a day.. The heat will help with the pain and also draw out the infection. Ibuprofen can help with the pain too and any inflammation. If this doesn't help then you may need to have it drained, depending upon how deep it is.
Going by your description along with it being painful, I would say more boil than a tumor at this point. But I'm not there to visually look at it.. So I can only go by your information. They can occur if your pants rub in that area, sweating or just because. There is no specific cause why some get them and other don't.
Hope this help.