The quadriceps muscles in the upper leg must be flexible to allow the knee to bend effectively.  When these muscles are tight or restricted, they can cause not only the knee to hurt, but the hips and ankles to get strained (and injured) as they try to take up the slack for the knee not working correctly.

http://www.youtube.com/watch?v=ietROUgbbZM