I'm going to disagree with Cheater here. In many cases the socket will be designed so that replacing the pull chain is impossible, and even if that's not the case it'll likely pull out again in the near future. Given that these sockets can typically be had from your local hardware store for under $10, you may as well just go ahead and pop a new one in.
I'm assuming we're talking about a typical bare ceramic fixture, something along these lines:
If you're replacing the entire fixture, Cynthetiq's link is good. If you just want to replace the socket and keep the actual fixture, though, you ought to be able to do that as well. The socket is usually held in the fixture with a plastic or ceramic nut -- it's just a matter of detaching the wires and loosening that off, then doing the whole thing backwards with the new socket.
Also, always always
always trip the breaker or pull the fuse when working on anything electrical in your home. I don't care how experienced you are, and anyone with home wiring experience will tell you you're an idiot if you don't. You don't want to fuck around with this stuff. It's usually a good idea to test the leads before you get to work just to make sure, but in this case you'll know the circuit's off when the light goes out, so if you absolutely must you can skip testing and probably be okay (although I still recommend it and cannot be held responsible if you fry yourself).