Both male and female dogs may spray, or mark what they consider their territory with urine. Dogs that are not spayed or neutered are more likely to spray. Spraying can occur when a dog is excited, because of anxiety or stress or because of new elements in its environment.
A dog may spray as a result of a medical condition. Conditions to look for include incontinence and urinary tract infections. Excessive excitement during play time, being exposed to female dogs in heat, receiving punishment, suffering from separation anxiety and not receiving proper house training can all result in a male dog spraying urine.