It is straightforward to calculate the greenhouse gas emissions from burning various hydrocarbons. For every unit of energy released natural gas releases about 57% of the carbon dioxide as bituminous coal and gasoline about 78% that of coal. It would seem that a from coal or even gasoline to natural gas would be beneficial.
The problem is this is for the fuels at the time of burning and the greenhouse gas cost associated with mining, processing and transporting the fuels is not considered. Diesel fuel is probably similar to gasoline and estimates are a bit under an additional ten percent. Natural gas is tricky as it is mostly methane, which is a much more powerful greenhouse gas than carbon dioxide. Relatively small amounts of leakage can have very serious impacts.
Several researchers are beginning to study emissions associated with the mining of natural gas and there is a reasonable question as to how much methane escapes into the atmosphere. Here is a note from Robert Howarth of Cornell who notes emissions from shale produced natural gas are higher than conventionally mined natural gas. His estimates, which he claims are conservative, suggest shale produced natural gas may have 1.3 to 2.1 times the greenhouse gas footprint of conventionally produced natural gas -- making it worse than burning coal.
It is pretty clear the transmission system for natural gas needs to be monitored and serious studies need to be performed on extracting natural gas from shale - the process may be an enormous step backwards. And even if the process and transport is perfect, natural gas should only be viewed as a very short term solution. We need reductions on the order of 80 or 90% -- 40% reductions are not adequate.