Once in a while I’ll wake up to a lovely charley horse (or muscle spasm) in my calf. What is the best stretch or exercise to do immediately following this?
The best stretch is to lift the tip of your foot and contract hard, without using your hands. It usually relieves the pain almost immediatelly.
To prevent the cramps (or charley horse as you called it) perhaps try drinking more water and ensuring you ingest enough minerals (calcium, potassium, and sodium).
Once I increased my water intake seriously (I went from drinking 1L / day to 3.5L) and some simple vitamin supplementation I essentially never had another night cramp.
To know the optimal amount of water to stay hydrated you could calculate 1L per 20Kg of body weight.