|MadSci Network: Earth Sciences|
Wind direction is determined by atmospheric pressure gradients. Air flows clockwise around high pressure and counter-clockwise around low pressure. When the pressure gradients tighten, wind speed increases, and when gradients relax, the wind speed decreases. If the gradient relaxes enough, such as when high pressure is centered over an area, then the wind speed can be light enough for the direction to vary quite a bit.
Other causes for varying wind direction could be a nearby surface front, or thunderstorm activity in the vicinity.
Try the links in the MadSci Library for more information on Earth Sciences.