From a Q&A on TMP but I thought I'd elaborate here:
When a figure Flinches and is not in cover, they will move up to 1D6" to get into cover. If there's cover 2" away and you roll a 5, the figure just moves into the cover 2" away.
If there's multiple spots possible, the figure will aim for cover that is closer rather than further and will avoid moving towards the enemy unless that is the only cover that can be reached.
When a figure Bails, they'll fall back 12" from the enemy and find cover there. The easiest way to do this is to take a ruler, place it so you can see what locations are in the figures rear area and have him run to one of those.
If you want a more specific ruling for pick-up games, find cover 11-12" away from your current position, and further away from enemies than you started.
If no cover is possible under those parameters, run 12" away from the enemy and towards the table edge.