I had one at night the other night- more of an unexpected ledge, but still... was in a group so I couldn't scan too far ahead- riders called out that there was a ledge, but when we had come in from that direction, I hit a spot where it was rather low- coming out it was much darker and the edge I hit had a much larger drop- cobblestone onto gravel- I didn't crash, thankfully, as there were about 8 riders right behind me but it was really startling.
When I can't react in time to do a rock dodge move- as mentioned above- I quick spin my pedals so they are parallel to the ground, hoist myself out of the saddle, and relax my elbows while holding tight- it lessens the blow and helps balance.