Go see a doctor.
My son once had shoulder/back pain only when swinging, didn't hurt when throwing or pitching. He went to the doctor, who said it was "only" muscle pain and he could play through it. But, we made sure he was thoroughly checked out before he hit again.