Have you tried icing? Either a bag of frozen peas or one of those blue gel ice packs, not bare ice to skin. I expect the doctor to prescribe icing with a pulled muscle. If it IS tensed muscles, a muscle relaxer can be prescribed. They work wonders but you'll be loopy for a day. Much cheaper than a scan.
It could be a muscle that is so tensed it has literally balled up, it could also be a bunch of nerves that are inflamed. If the pain persists, you may ask to see an orthopedist and also have an MRI and/or CT scan. Xrays do not shwo everything and are not always reliable. The MRI and CT scan can show if it is a muscle, bone, tendon or ligament. Hope this helps.