Your knee is like the middle child. It will never be as strong as the hip or able to move like the ankle. It's stuck in the middle. If there is a problem up or down the leg, it's the knee that will feel the pain the most. When you're running your knee is safest when directly above your ankle. This is how it goes wrong:
Related story: Endurance test: how to prepare for running season
The problem: When your foot hits the ground, your knee can drift in towards the middle. The muscle that prevents this drift is your glutes (bum). To cure knee pain, you need a strong bum.
The solution: Lunges. This is best done in front of a mirror to ensure your knee is directly above you ankle. Start with stationary lunges. Focus on using the heel of your foot to push into the ground. Once you feel comfortable progress to walking lunges.
Related story: On your mark: how to prepare for the City 2 Surf
The problem: Not everyone can run in Nike Frees or similar lightweight shoes. Unsupported pronation (rolling in) at the ankle will cause the knee to drift in towards the middle.
The solution: Shopping. Find a store that films your running action and fits you with the right shoe for your landing pattern.
Related story: How to overcome your biggest health obstacle: motivation
3. Running technique
The problem: Have you ever run behind someone and watched their foot flare off to the side after each stride? A sloppy technique also causes your knee to drift towards the middle.
The solution: Tramtracks. Run on a treadmill where you can see your reflection in the window. Imagine your feet are on a set of very narrow tramtracks. Focus on pushing off your toes and bringing your foot forward in a straight line. Practice this in 1-2 minute intervals to begin with.
The cure for runner's knee consists of the above three solutions, combined with increasing the mobility of your calves, hamstrings, hip flexors and foam rolling your ITB (side of your thigh). Good luck!