Let's say there was a planet where sonar dominated instead of visual sight. In this case I'm referring to life above the water, walking or flying in the air. This inspires several questions: What would the equivalent of deterring predators from eating you because of poisonous flesh be since colored skin isn't an option?
To add to Mary's good answer, I'd suggest a sound that's very disruptive. It's either very loud, very annoying to predators, or prevents location of the prey by causing the echo location to become "fuzzy".
For the first option, simply a loud noise that scares the predator off or potentially hurts their ears might be good enough. Something on the order of an elephant trumpeting or a whale communications that's just scary, sudden, or painfully loud.
To annoy the predators, I'm thinking on the lines of fingernails on a chalkboard for most humans. It has to be something that literally drives the predator away. Hissing works for snakes, growling and barking works for dogs, and a variety of other animals have a variety of other noises they make to warn predators away. This can include mimics. I just recent recently heard that cats hiss, because it imitates the hiss of a snake to keep danger away.
To cause echo location to become "fuzzy", you can have the animal produce their own tones to mimic the predator's signal so that it sounds distorted or reflected strangely and prevents the predator from accurately locating the prey. This would be something like old speed camera tricks. With the old system, it was possible for a target vehicle to detect the radar signal, then produce it's own signal back at the police car so that the speed of the car would look like it was either going the speed limit or the radar gun was malfunctioning with randomly changing the speed the car appeared to be travelling. With an animal, it could be used to produce an effect that the animal had fled, was much bigger then reality, was a different shape, or changing shape in disorienting ways. A predator likely won't attack unless they think they understand the prey and can be successful in killing it.
- unpleasant scent, though this is dependent on prevailing winds
- unpleasant taste. It does limit the ability of the victim to survive, but others of the species will benefit.
- A skin surface that reflects sound oddly. Perhaps more intensely than most surfaces. Perhaps it manages to shift the sound.
- The organism's own sonar is unusually pitched or loud, or perhaps pulsed in some manner. Maybe it's steady when other creatures use theirs more selectively.
- Unusual shape that can be picked up by sonar.
You can hear overtones just like musical instruments. A C on a piano sounds different than a C on a violin than a C on a flute. So you know what kind of surface you're echoing off of.
If you are using time-of-flight then you also know how far away something is and the strength of the return signal also lets you know how hard the surface was since you know the strength of the signal you sent out and how far away it had to travel.
And all this is assuming you can't map out what the shape of thing is.