2 weeks before my half marathon I was doing a 17 mile run and at the end of it I had a pain on my right knee. The following day it got worst so I decided to look online for some answers and came up with runners knee. Runners World descrives the injury as "it occurs when a mistracking kneecap (patella) irritates the femoral groove in which it rests on the thighbone". This happen on a Tuesday and I decided to stop doing any exercise until a 5k race on Sunday, I could feel pain every time I landed my foot heal-to-toe and had to keep reminding myself to land mid-sole, which alleviated the pain. Three days before my half marathon I went to a physical therapist that gave me exercises to do and taped it with KT Tape. The tape helped a lot but the pain is still there which has changed my training dramatically, now I have gone from +30 miles per week to less than 5 but more strength and cross training.
My plans to avoid this in the future are to become stronger in the legs, better hip stretches, and because I have scoliosis, which make my feet land on their heel, I have to remind myself to land mid-sole.