Chasing shadows or lights can start as a momentary distraction, which the owner finds amusing, but can soon escalate to a severe behavioural problem. The behaviour may have a serious and negative impact on the dog’s quality of life.
The chase is the start of the predatory sequence, which is natural to many dogs, but as there is no way to complete the sequence, it’s incredibly frustrating for the dog; it can become an obsession, as the dog attempts to catch his ‘prey’. This is the reason why laser toys should never be used with a dog.

Prevent the behaviour as much as possible by closing curtains to prevent shadows, covering anything shiny to prevent reflections, and walking when the sky is overcast. In the early stages, you should be able to distract your dog and guide him to a more appropriate behaviour, but in the later stages you are likely to need expert help from a veterinary behaviourist.
Here are some really useful links on the subject:
How to Train Your Dog to Stop Chasing Shadows