RainX makes an anti fog product specifically for use on windshields, but I don't see why you couldn't use it on a helmet visor too. To be honest, in my experience using it on windshields it doesn't work all that well, but it's better than nothing.
Alternatively there is a wide variety of anti-fog solutions made for sucba diving masks that I have had a lot of success with in those applications.
The key to using any of these products, whether it be RainX or something else is to make sure the interior surface is crystal clean. Toothpaste actually makes an excellent polish/cleanser for these types of surfaces. Put a small dab on the inside of the visor and then scrub with wet fingers for a minute or two. Rinse with clean water and lightly dry with a paper towel. Avoid getting any oils or other chemical residue on the surface after it's clean.