If it rains for a whole day, there are fewer chances of wiping out the treatment completely, but it will make the treatment less effective. If it rains heavily for 2 or 3 days, then the best thing would be to reapply pesticide again. There are a few pest control treatments such as lawn granule pellets that work best in the rain.