There can be a number of things going on from muscle imbalances to alignment problems. The problem is that they can feed off of one another. For example muscle imbalances can pull your spine out of alignment, and the alignment makes it difficult to balance the exercise. Basically when you have one group of muscles significantly stronger than another group, the weaker muscles have to work harder to function properly, and can lead to cramping and tightness because they can never rest.
Assuming the problem is due to muscle imbalances (for example the quadriceps are much stronger than the hamstrings/gluteus) make sure you are doing the following:
- For every muscle group you exercise, make sure you also exercise the complement.
- Cool down properly
- Stretch when done
For example, when you do bench presses you are working out the front of the upper body. The complement would be to do rows which work out the back of the upper body. Squats get the whole leg, front and back when you go all the way down. When doing weight lifting, you engage both your abdominal and back muscles to keep your core strong.
Cardio vascular sports like running, cycling, and swimming will exercise the front and back legs. They'll also provide strength to your core, and swimming exercises the entire body. These may be a very good option for you.
Cooling down is a matter of bringing your heart rate down while still moving. If you weight lift, do light cardio to cool down. If you run, walk for your cool down. It's an important part of exercise recovery, and helps lessen the effects of lactic acid buildup.
Finally, stretching helps the muscles become longer and less tight. Stretching alone won't fix the muscle imbalance, but can prevent the strong muscles from becoming too tight and causing more strain on the weaker muscles.
Depending on the type of pain, there is another possibility with an easy fix. If the pain is from your sciatic nerve (emanating from the gluteus maximus upwards), it is most likely on the side you have your wallet in. I've dealt with chronic pain there in the past. The easy solution? Put the wallet in the front pocket so you aren't sitting on it any more. When a coworker told me about this it was like a light bulb went off in my head. If that's the cause of your pain, it will go away in a couple days after switching the location of your wallet.