Frightened from the Pathfinder Core:
A frightened creature flees from the source of its fear as best it can. If unable to flee, it may fight. A frightened creature takes a -2 penalty on all attack rolls, saving throws, skill checks, and ability checks. A frightened creature can use special abilities, including spells, to flee; indeed, the creature must use such means if they are the only way to escape.
Does this mean that on the creature's turn, it would take a withdraw (2x speed) action (avoiding attacks of opportunity)? Or would the creature simply run (4x speed) as far as it could, taking an attack of opportunity in the process?
In a related question, how about panicked? Panicked from the Pathfinder Core:
A panicked creature must drop everything it holds and flee at top speed from the source of its fear, as well as any other dangers it encounters, along a random path. It can't take any other actions. In addition, the creature takes a -2 penalty on all saving throws, skill checks and ability checks. If cornered, a panicked creature cowers and does not attack, typically using the total defense action in combat. A panicked creature can use special abilities including spells, to flee; indeed, the creature must use such means if they are the only way to escape.
Again, does this mean that the creature must attempt to run (4x its speed) and take an attack of opportunity in the process as opposed to the safer withdraw action (2x speed).
I could see a frightened creature attempting to withdraw, while a panicked creature would run and take an attack of opportunity, but I'm not sure.