Electromagnetic waves and thermal radiation