The most likely explanation is that the iliotibial band (IT band) is snapping across the outside part of the knee joint. The IT band is a thickening of fibers that arises from the lateral (outside) hip and extends down the outside of the thigh attaching to the shin bone. Because the IT band crosses over the lateral hip and knee, it can cause painful friction disorders over one or both joints. This is commonly referred to as IT band syndrome. Increase the length of the IT band by foam rolling and statically stretching the IT band and tensor fascia latae (a small hip muscle that lies on side of your hip). Increasing the strength and endurance of the muscles that surround the hip may also be helpful in relieving symptoms. Side planks, bridges, and side-lying abduction (leg lifts) may prevent faulty mechanics by strengthening the muscles that surround the hips. Regularly incorporate activities into your training routine that challenge your balance. Balance activities generally start on stable ground (i.e. single leg stance), progress to an unstable surface (or stable surface with upper/lower extremity movement), and finally move to more dynamic activities that involve unstable surfaces and upper/lower extremity movements. Finally, make sure you have appropriate footwear, and ramp up your training slowly. Back off at the first sign of pain--this is an indication that you increased your time or intensity too quickly.