Treat the underlying cause that is disturbing the muscle physiology after proper investigation of any possible medical problem. However, if the problem is benign, you may apply local heat or cold application according to the patient comfort to break the pain spasm cycle. At the same time try slow gentle and sustained muscle stretching to restore the original lenght of the muscle. It will be of help to you.