It can be a lot of things. If it's the back of your right hip, it's likely not your hip flexor (that would happen on the front). If it's on the back of your hip, it can be your hip joint capsule, possible nerve impingement (if you get symptoms down your leg especially), gluteus maximus/medius/minimus strain, hip external rotator strain, sprain of the ligaments surrounding the lumbar spine or sacroiliac joint, referral from lumbar spine, etc. Get checked out by your doc and, if it doesn't start to go away in 1-2 weeks (from the time that you noticed it), ask for a prescription for physical therapy.