It is easy to tell the difference between rays hitting your body and when they’re blocked. (for instance when the sun is blocked by a cloud).
The rays of the sun do not mainly heat air but the bodies and objects they hit.
The sun is the world’s best heater. The rays used for infrared heating are the infrared rays.