I like to pray the rosary as much as possible. However, I have a short attention span and sometimes my mind inadvertently wanders away from meditating on the mysteries. Am I committing a sin while doing this?
Of course not! Your intention is to pray. Morality is determined by our intention: what we know and will. You will to pray and involuntarily you mind wanders. When you realize this, you focus again on praying. Even when your mind was wandering, part of you was still praying. When you regain your focus, all of you is praying.
Fr. Vincent Serpa, O.P.