I once also had a strep and fungal infection on the hip area where my pants were rubbing. I don't know why it got there but it did. The doctor treated it and it went away. It itched badly. So it can be a variety of things including staph and also an allergy. You need to get to the root of the problem.
mkh9
Mkh9 has a very good point. I had a friend with a similar clothing-rubbing rash and it turned out to be staph. If it gets into your blood stream, it is bad news. Definitely go to a doctor ASAP to get it looked at. Be sure to ask about staph when the doctor looks at it. My friend's doc didn't check hers out for staph until it had persisted for a couple months and hadn't responded to to a mild topical cream.
Probably an allergy to something on your pants! I'd say switch to a free and clear laundry soap and don't use dryer sheets... also try to wear looser fitting pants (see if wearing sweats for a day or two doesn't clear it up). If it still doesn't go away, see a doc.
How do you know it is a rash and not a staph infection? you may want to get have doc take a look at it. Try not to scrach if it isn't infected it may get that way.