All of those are Terragen 0.9 images actually. You would have to contact the author to find out specific information on the techniques used. The approach in Terragen 2 would likely be rather different.
Sand is best done with a smooth, low displacement surface and a child layer of small scale with very small scale displacement.
Rays depend mostly on lighting conditions and clouds. The basic formula is to create clouds and then position your sun behind them such that shadows are cast into the atmosphere. Having a hazier atmosphere can help as well.
Caves are do-able in TG2, much more so than in TG 0.9 in fact. There are many methods to achieve this effect. The easiest is probably just to use a basis heightfield of a canyon or narrow "slot" feature, then displace the walls laterally by a large enough amount that the tops of the canyon join, with a hole left below. This will take some experimentation to achieve, of course. Blending displacement by height with a Distribution Shader or Surface Layer would make it easier to ensure a cave is left at the bottom.
- Oshyan