""Magnesium and malic acid are also critical. When malic acid and the other compounds are low, the body often has to shift to the very inefficient (anaerobic) means of generating energy. This contributes to the abnormal buildup of lactic acid that occurs after exercise ... This causes muscle achiness and fatigue"
and if we're talking about more than just sore muscles, eg "To be clear, this is not a matter of sore muscles; it's something else altogether.", then magnesium status could be even more highly suspect.
magnesium is useful in extreme cases of spasm such as tetanus:
Magnesium as first line therapy in the management of tetanus: a prospective study of 40 patients. http://www.ncbi.nlm.nih.gov/pubmed/12133096
"Spasms were controlled in 38 of the 40 patients within a serum Mg(2+) range of 2-4 mmol/l with only two patients needing additional neuromuscular blocking drugs. Seventeen of 24 patients (< 60 years) and six of 16 patients (> or = 60 years) did not require ventilatory support."
and, one more study:
Painful muscle spasm reversed by magnesium sulphate. A case report. http://www.ncbi.nlm.nih.gov/pubmed/4035497
"A 25-year-old paraplegic man who had sustained a T3/T4 vertebral compression fracture 3 years previously presented with severe, painful spasm of the left hamstring muscle group of 2 hours' duration. This spasm produced extreme knee flexion of a degree which held the left foot posterior to the right buttock. An intravenous injection of 2 g magnesium sulphate produced immediate relief.
feel better soon!