Rain rot is one of the most common skin infections seen in horses. It is also referred to as "rain scald" or "streptothricosis". The organism that causes rain rot, a bacteria named Dermatophilus congolensis, appears and multiplies in warm and damp conditions, so the better way to prevent it is to avoid humidity.
The same goes for treatment, the first thing to do is to avoid humidity as much as possible (wet grounds, showers…).
In early or less severe cases, local treatment may be enough, simply remove the scabs by washing the affected areas with antimicrobial soap. The better is to make 2 shampoos in a row, one to remove the dirt and then, one to let act about ten minutes for antiseptic action, dry well and do not renew before at least a week if necessary. A non-irritating antiseptic cream can be applied daily to the lesions.
It can be useful to clip the affected areas when it comes to members.
However, more severe cases in which the infection has affected deeper skin layers might require your veterinarian to give some general treatment.