Medical causes
Feline idiopathic cystitis, urinary stones, infection, kidney disease, diabetes, arthritis, constipation, and other painful conditions can affect litter-box behavior. Older cats may struggle to enter a high-sided box or travel to a distant location.
Marking or full urination?
Urine marking often involves small amounts sprayed on vertical surfaces with the tail raised. Inappropriate toileting more often involves a larger puddle on a horizontal surface. The distinction helps, but some cats show mixed patterns.
Improve the litter-box setup
Provide multiple clean boxes in separate, quiet, accessible areas; offer unscented litter that the cat accepts; and avoid placing all boxes side by side. In multi-cat homes, separated resources reduce competition.
Do not punish the cat
Scolding can increase fear and stress and does not treat pain, urinary disease, or aversion to the box. Clean soiled areas with an appropriate enzymatic cleaner and work on the cause.