While it's true that sunlight can contribute to rock weathering, the process of breaking rocks into small pieces is actually more complicated than what your friend suggested. Sunlight does not directly break rocks into small pieces, but it can cause temperature changes that lead to physical weathering, which can eventually break rocks down into smaller pieces over time.
When rocks are exposed to sunlight, they can heat up during the day and then cool down at night. This constant expansion and contraction can cause cracks to form in the rock, and over time, these cracks can deepen and widen. Water can then seep into the cracks and freeze, expanding as it does so, which can further widen the cracks. Eventually, the rock may break apart into smaller pieces due to these physical weathering processes.
So, while sunlight is not directly responsible for breaking rocks into small pieces, it can contribute to physical weathering, which is a more complex process involving a variety of factors, including temperature changes, water, and other environmental factors.