there is a specialized gunsmith tool for this...
I did this fix on the fly (while traveling for a guy) and should have taken pictures of it, these are of the Text pictures he took of the before and after for me.
The light in the after pic makes is look a tiny bit bent... but neither of us could figure out where it was bent after I tweaked it back into place with the tool.
I think the shotgun (Beretta 390) slide off something and hit the rib straight on..
Before
After using the tool
the light in the picture makes it look bent a slight amount, but we couldn’t see that... heck we couldn’t find where it was bent after looking for it once it was done.