It depends on the type of cable. If it has a plastic liner around the wire it wont do much good to try to lube it. If you can take the wire out of the housing, especially when it is new, you can coat the wire with grease and put it back in the housing. That will help increase the life of your cable. Some cables can just be sprayed with some good lube and it will soak through the cable.
I have even used motorcycle chain lube to coat the housing to keep out moisture. Will pick up dust on the outside. We keep a z bend tool to put a z bend back in our new cables when we cut off the z bend to get the wire out of a new one. Some cables that have a special end on them, don't cut.