How to handle frayed/old wire in can light
I am looking at the 3 clips on either side of the socket and I am guessing the cans frame is a remodel type. This means you can take it down from the ceiling and then either replace the entire can or replace the socket and the wiring. Those clips can be loosened with a screwdriver or needle nose pliers and the entire frame can be pulled down from the ceiling. If they are not remodel frames, can you access the frame from the attic or crawlspace or you can take apart the can frame and you will see a junction box on the side.

If you do this you can replace the wiring between this j-box and the socket. Be sure to use high heat fixture wiring which you can purchase from a fixture parts supplier. Do not use thhn/thwn. If the cans are remodel frame you can just replace the entire fixture frame. 

I vote for replacement. They are fairly inexpensive and not that hard to install.

Good luck.