The remediation for a tree in the picture below will be difficult, and an arborist should be consulted to save the tree.
In this instance excavation of the soil will be necessary, but you will need to be careful not to damage roots. The best tool for this job is an air spade. An air spade can remove soil from around roots, aerate the soil, and can be used for conditioning soil safely around roots in a way that traditional excavation equipment cannot.
All tree roots need oxygen to survive. Compacted soils, too much soil, and excess soil moisture can deprive the roots of oxygen. Factors such as these can lead to girdling roots, which will lead to tree decline and potentially failure and death.
If you own a tree that you suspect may need soil conditioning or remediation services, consult an arborist before attempting to undertake this project on your own.
Here is a great link for locating a qualified arborist. http://www.isa-arbor.com/findanarborist/arboristsearch.aspx
Gap Power rents the Air Spade and sells Arborist equipment as well.
http://www.gappower.com/AirSpade-2000-Air-Excavation-Tool-150scfm/item/AIRSPADE
http://www.gappower.com/Arborist-Supplies/folder/1350