Sun plays an important role in weathering of rocks for soil formation. It heats up the rocks during the day.
Heating causes the rocks to expand. During night the rocks cool down and contract. Different parts of a rock expand and contract at different rates resulting in its cacking and breaking up into smaller pieces or fragments (boulders).