I also have these same symptoms--muscle spasms in stomach and ribcage. I had an upper endoscopy yesterday and one of the findings was erosive gastritis and esophagitis. Gastritis can cause this same symptom, and chronic acid reflux can cause gastritis, although there are other causes as well. If you're already being treated for acid reflux, as I am, I'm not sure what you do about it, but I would recommend that you find a doctor who is willing to do an upper EGD just to document the gastritis--has to be confirmed via biopsy or it's not considered legitimate.
It does hurt, in any case, doesn't it? Sometimes a heating pad will help, and low dose bentyl stops the spasms for me altogether--bentyl is used for IBS, but is also appropriate for bladder spasms and stomach spasms.
I hope you feel better soon,
Current dx: Rheumatoid Arthritis
Suspected dx: UCTD/Early Lupus
Current Meds: Enbrel, Plaquenil, Aciphex, Ultracet, Zyrtec, Allavert-D, Zantac, Tylenol PM
Past Meds: Relafen, Vioxx, Mobic, Voltaren, Sulfasalazine, Entocort, Prednisone, Humira, Reglan