On my older bikes I lube my cables with Finish Line Extreme Flouro Teflon grease. Yeah it's expensive but you only have to lube them once. The stuff lasts forever. When the DuPont Pure Teflon Bearing grease was still available I used that. The Finish Line product is basically the same thing. This grease makes for a very slippery cable! Better than regular grease in my opinion.
As was previously stated, some modern cables and housing are not meant to be lubed. I have two bikes with that type of cable and I don't lube them at all but do pull the cables out once a year and clean them.