Healing time will depend on if it's bruised, cracked or broken. I broke a couple of ribs about 5 years ago. I have also both bruised and cracked others. (What can I say? I play hard. I'm also clumsy.) My doctor laid it out as:
4-6 weeks = bruise
8-10 weeks = cracked
12-16 weeks = broken

Except for the time there was a break (which I already suspected, because I could feel something moving around in there and it grossed me out), I never had x-rays done because there wasn't much the doctor could do for me other than prescribe painkillers and tell me to take it easy while I waited out the pain.

I've always been told that I could ride pretty much as soon as I'm not so sore that I can't breathe properly or hold myself up on the bike. Generally with cracked or broken ribs, even breathing is a painful experience...and deep breaths can sometimes make you stop in your tracks.