Ribs are made to be flexible. If they weren't, we wouldn't be able to breath or bend over. When we, or a dog bends in the middle, we reduce the space containing our organs, forcing them together. The ribs expand to prevent them from crushing each other, or compressing them enough to cause damage.
This is why broken ribs are so painful. They cant be fixed into place with a cast. Breathing and movement are painful because it causes the ribs to flex.
Tom