Well...Ford did a lot of crappy lighting things in the '80s and '90s (and they're still doing it in more recent years). One of the crappy things they did in the early 1980s was pitch NHTSA on a bad specification for replaceable-bulb headlamp systems. The overwhelming priorities were low production cost and design flexibility (in other words: cheap and prettier than sealed beams). NHTSA adopted Ford's system -- lock, stock and barrel! That is how we wound up with the lousy 9004 and 9007 bulbs and cheap plastic headlamps.
At first these did not have any vents; it was imagined that the lamps would be sealed except when the bulb was being replaced. The lens was glued to the reflector, the bulb had a beefy silicone O-ring on the base, and this didn't work any better than when the Brits tried a very similar construction about ten years earlier...they quickly learned that headlamps must be able to breathe, otherwise water will enter. Because sooner or later, one of the seals is going to stop sealing.
When turned on, the air inside the lamp heats up and tries to expand...creating inside-to-outside air pressure. If all the seals are perfect, that pressure will hold, then when the lamp is turned off and the air cools down, the pressure will go back to atmospheric. But if (WHEN) one of the seals doesn't seal perfectly, the pressure won't hold, it'll bleed out from the inside of the lamp. Then once the lamp is switched off, the air inside cooling down will pull a vacuum, exerting outside-to-inside air pressure, and that's very likely to pull moisture into the lamp. Once it's in, it will not get out (because there's no breathing provision). And that's how we wound up with so many sloshing bath tub headlamps.
Eventually, American industry figured out exactly what the Brits had figured out before, and started ventilating the headlamps. Ford was probably still making the "hermetic" (pretend-sealed) kind well into the '90s, and the '97 Ranger headlamp is one of those.
Alaric is right in his advice not to use RTV, which attacks the reflector material (assuming it's not already dead of old age). Windshield urethane doesn't do that, but if you have a problem with headlamps like this taking on water, the solution is to add vents, not try to seal it up "gooder". One quick and dirty way of doing it is to remove the bulb O-ring, cut about 1/4" out of it, then put it back in its groove in the bulb with the cut pointing down (6:00 position).
The ECE (European H4) headlamps for these trucks were considerably better than the US lamps.