Change the switch, trace the line back to the next junction and look for brittle, frayed wiring, loose nuts, etc.