If your pain is on the outer side of your ankle, the most common cause would be trigger points (small contraction knots) in the peroneus longus muscle on the outer side of your lower leg. (Trigger points characteristically send pain to other places.) If these trigger points are the cause of your pain, you can treat them yourself with massage. Press in with both thumbs on the outer side of your lower leg about a hand's width below your knee. Search about a three-inch circle. If it hurts there, you've found a trigger point. Use repeated strokes, an inch or two in length, with as much pressure as you can stand. The correct pressure will cause only a pleasant kind of pain. I've had this pain myself many times and I'm always able to cure it within two or three days.
There are other trigger points in other muscles that send pain to the ankles. They include the tibialis anterior, tibialis posterior, extensor digitorum longus, soleus, peroneus brevis and peroneus tertius. These are all muscles of the lower leg. Two muscles in the foot, abductor hallucis and abductor digiti minimi can cause heel pain, which sometimes extends up into the ankle. Chapter 10 in my book deals extensively with ankle pain, if you'd like to find out more.