Agreed with Shaney, this is classic signs of compulsive behaviour. It occurs mostly in working breeds, border collies, springer spaniels, I have seen it in some dalmatians and weimeraners too.
At 10 months old its a good idea to do something about it now.
Does your dog get at least one GOOD run every day?
You need to do things which use up his physical energy and test his brain (I am assuming your dog is a boy, I apologise for calling him a "him" if not). For example plenty of good old running about a field mixed with some good training, things like agility and flyball are excellent for this sort of thing. Make up some games which will get him using his head, hide a treat under one of three cups and shift them around, magic trick style, and get him to find the biscuit, little things like that make all the difference.
Teach him some tricks and make sure that when he looks like he might start chasing shadows or lights distract him with a game before he really gets into it.
Good luck, keep us posted! x