Many cables these days are Teflon coated or don’t require lubrication, so you probably don’t have to oil them anymore — but if you do, a cable oiler seems to be the way to go. Of course, you should check with the manufacturer before you try to lubricate it or you could just make things worse.
You clamp the first type of cable oiler over the end of the cable and spray lubricant through a straw into a small hole in the block — though I’ve read using this method can be quite messy. Another method is to use a hydraulic cable oiler. You stick the cable into the end of the oiler and tighten down the cap, which compress the rubber disks around the cable to make a seal. Then fill the tube with oil and screw in the end with the T-handle. Twisting the T-handle forces oil into the cable.
You can pick up the block-type cable oiler starting around $6. For some reason the hydraulic cable oilers are more common over in the UK, so next time you’re overseas you can pick one up for £17 ($26). Unfortunately I couldn’t find any suppliers in the States.