Are you using anything when having sex? For masturbation? Perhaps this is an allergic reaction?
It might also be if you aren't - maybe it's too much friction causing chafing. It could be dermatitis, eczema, or a host of other things.
You should get it checked by a doctor.