Temperature differences in sand
Yes sand is, on average, quite insulative with the temperature at the surface being rather higher than that at depth when the surface is being actively heated, as by sunlight. The actual degree of insulation depends on at least three factors;


Moisture content, wetter sand is less insulative than dry sand because the water in it's pore spaces conducts heat better than air filled pores would.
Average grain size, courser sand has more pore spaces and thus more of it's total volume is made of air so it's more insulative at a given water content.
Grain size distribution and sorting, sand composed of grains that are all of a similar size will have more pore spaces than sand composed of many sizes of grain. Grains of the same size act like stacked ball-bearings leaving a lot of empty spaces but with larger and smaller grains the pores between the large grains are filled by the small ones leaving little space for insulative air pockets.


Due to the complexity of the processes involved it is very difficult to have any single formula that gives you a measure of sand in general. You may be able to find, or create, data sets that allow you to predict the insulative value and thus temperature at depth of a particular sand under a particular set of circumstances. Generally speaking it's easier to take field measurements, unless there's a really long-term project involved.