It can be a dominance thing, a defensive thing, an "I'm feeling slightly uneasy" type of thing - sometimes if they've eaten a lot or drunk a lot you'll see them doing it...
Is it just doing it briefly then relaxing, or is it holding its beard out for a while?