You're right that they need different energies. If you graph the energies of photons emitted due to heat radiation, they'll form your typical bell curve, with the peak of the bell curve representing and energy level corresponding with infra-red radiation. That having been said... a few standard deviations from the center, you'll see the (very rare) photons emitted that have energy levels corrosponding with visible light. This happens when enough energy concentrates (by random, highly unlikely chance) to create a photon with much higher energy than is typical for a radiating body. It's very, very unlikely for ay given photon, but photons are created very, very often, so it happens frequently, though not enough to create intense enough light to see.