Well, if you were doing bench presses and hurt your ribs and now the pain radiated to your back, t could be few problems. You might have irriated the serratus anterior muscle which runs along the ribs. This muscle does assist with this exercise. The cracking may be dervived from the vertebrae being pulled by tight muscles, causing the vertebrae to be out of alignment. The shoulder cracking may be a result of tight scapular muscles (Wikipedia reference-linkrotator cuff). If one muscle is tight, it will cause the entire mechanism of the shoulder to be off. The cracking of the shoulder is from the humeral head hitting the clavicle. The first thing to do anytime you have an acute injury goes back to the basics rest, ice and anti inflamatories. I would try to get the inflammation decreased then ease into gentle stretching of the serratus anterior, scapular muscles, cervical region and along the entire errector spinae. All these muscles work together and its a dominio effect, if one is irrirated, they all will be compromised. If the pain is severe for more than 5-7 days go to the doctor.