I'm landing an unmanned spacecraft on Mars (or substitute your astronomical body of choice here.) I would like to avoid rock outcrops and land on relatively soft soil. What kind of sensor could distinguish between rock and soil from an incoming lander?
For a modern autonomous lander, a mix of sensor types will likely be used, but for rock-avoidance, I think LIDAR and optical scanning is probably the most important. Modern computing techniques can derive a 3-D model from stereo camera imaging in real time.
Strictly speaking, that doesn't distinguish between hard rock and soft soil, but between flat and non-flat terrain, which may be the more important distinction to your lander. It might be possible to characterize the consistency of the surface with a mix of visible and IR optical and radar sensing. Preferring a consistently colored flat surface to a varied one could be a valuable secondary guidance criterion.