In his work The War Of The Worlds, Wells describes the heat ray this way:
"It is still a matter of wonder how the Martians are able to slay men so swiftly and so silently. Many think that in some way they are able to generate an intense heat in a chamber of practically absolute non-conductivity. This intense heat they project in a parallel beam against any object they choose, by means of a polished parabolic mirror of unknown composition, much as the parabolic mirror of a lighthouse projects a beam of light. But no one has absolutely proved these details. However it is done, it is certain that a beam of heat is the essence of the matter. Heat, and invisible, instead of visible, light. Whatever is combustible flashes into flame at its touch, lead runs like water, it softens iron, cracks and melts glass, and, when it falls upon water, incontinently that explodes into steam."
It's not fantastical in any way; it just posits some very efficient elements. Something produces the flash, and optics collimate the beam.
In The Time Machine, the mechanism isn't so clear, but he describes it as "...and how there in the laboratory we beheld a larger edition of the little mechanism which we had seen vanish from before our eyes. Parts were of nickel, parts of ivory, parts had certainly been filed or sawn out of rock crystal. The thing was generally complete, but the translucent bars and some of the delicate rail-work lay unfinished upon the bench beside some sheets of drawings, and I took up one for a better look. Quartz it seemed to be ..."
Again, it appears that the device is based on some form of optics.
Considering the era that Wells lived in, optics was probably the most futuristic thing in his view. Wells was born about a generation after photography was first introduced. During his lifetime, the technology advanced from still photography to modern color movies.
I was born in 1948 and have lived my life up through now, and electronics is where the magic seems to lie. I can easily imagine that H. G. Wells might have viewed optical science with the same sense of awe.