It's either scratches (likely, if the horse's leg is clipped and in wet conditions) or "stud crud" which is not a fungus at all but a product of the horse's own glands. Scratches is usually painful to the horse if you pick at it and generally bleeds if you pick off the scabs. Stud crud is waxy, sticky and usually clumps all the hairs together. For scratches try to keep it as dry as possible. I like washing with MicroTek shampoo (anti-fungal) then applying a thick layer of desitin (diaper rash cream). If it's stud crud, you can find topical things for it or talk to a veterinarian to get a prescription shampoo.
"Always be yourself. Unless you can be a unicorn. Then, always be a unicorn."