Rain rot is caused by the fungal organism Dermatophilus congolensis. Other names of the disease are rain scald and streptothricosis. Contrary to what a lot of people think, the organism has not been demonstrated to proliferate or be present in dirt or soil. The organism is dependent on a carrier animal who has the organism on its skin, and who may or may not be affected by it. There is some natural immunity, but some animals seem to be more susceptible to it, and that's why some animals get it year after year.
With any fungus the best treat are dry conditions. Keeping air circulation to the area affected is the best. They make great topical antifungals. Sullvans make an antifungal shampoo.