This is commonly called "fly strikes." It may look almost as though the dog is striking at flies that are not there.
This is often caused by vision loss, age and seizures.
It also could be a sign of liver shunt disease.
You can read about seizure problems and causes in dogs here
http://www.geocities.com/labsr4ulist/pawseizures.htm
If you can catch the behavior and video tape it, even if it's only for a few seconds, this will help your vet to help your dog.
Some dogs do it and it means nothing so I would not get too worried. However, I would try to document the behavior at your first opportunity.
There is not much that you can do at home except maybe try an herbal remedy called homeopet (www.homeopet.com). It's a natural anxiety reliever so it will help if this is an anxiety disorder or the dog is troubled and anxious.
Let me know if you still have questions.