I had always thought these cavities were formed by wind erosion, aided by sand etc (associating them with deserts and windy coastlines). I am pleased to have now learnt that they are indeed caused by chemical processes involving salt.
I am clearly no expert on this subject, but was interested to find out that they are called "tafoni", and that these features have also been observed on Mars! The following website may be of interest to the person asking the question.
www.tafoni.com