Often tight in runners, the hip flexors need stretching for optimal gait.
The TFL (Tensor Fasciae Latae) is a difficult muscle to stretch. It connects the pelvic crest to the Iliotibial Band (ITB) at the top of the hip. If you try to stretch it normally, the ITB will take up most of the slack. Try foam rollering instead. You can carry on down the outside of the leg to the knee to stretch the ITB as well - normally quite painful! Start against a wall instead of lying down if you find it too much.
Weakness in the Glute muscles, often one-sided, can affect walking and running gait resulting in pain in the hips and knees. Here's a good exercise to test and strengthen the Glutes.