How do thorns of rose plant help to get sunlight?

The thorns of the rose plant does not help it to get sunlight but it defends it