This is the characteristic urine marking behaviour shown by cats. Most people choose to have their tomcat neutered because of concerns over spraying. However, neutered male cats and female cats also spray. This is a form of territory marking so can occur outdoors. If a cat starts to spray indoors it may be because of a perceived threat such as a new arrival in the home, redecoration or a change in the room layout.

SOURCE: cats.org.uk