What happens next?

How to prevent a cat from spraying
Get your cat spayed or neutered.
Un-neutered male cats are the most likely culprits to engage in this very undesirable behavior. Occasionally un-spayed females will do this as well.
Therefore, it is advisable to neuter or spay your cat before the age of 6 months so as to curb this behavior from developing when puberty hits. However, a small percentage of neutered males and an even smaller percentage of spayed females will spray.