Cats spray to mark territory. They usually use a distinct posture. Your cat will then walk directly away from the area, without sniffing or digging. It will typically mark in many different areas of the house, especially near doors, windows, on beds, and on new furniture. If your cat sprays a horizontal surface, it can be differentiated from urination in that it typically leaves a long, thin wet area, rather than a puddle.
Cats look very different when they are urinating merely for elimination.
They use a squatting posture, usually voiding large amounts onto horizontal surfaces. Unlike cats that mark, cats that are eliminating usually scratch or dig before and after voiding. Cats rarely defecate to show marking behavior. Cats eliminate outside the litter box for a variety of reasons. Your cat should have a thorough physical exam by your veterinarian.