Petrology (from the Greek πέτρα, petra, "rock" and λόγος, logos, "study") is the branch of geology that studies the origin, composition, distribution and structure of rocks.
Lithology was once approximately synonymous with petrography, but in current usage, lithology focuses on macroscopic hand-sample or outcrop-scale description of rocks, while petrography is the speciality that deals with microscopic details.
In the oil industry, lithology, or more specifically mud logging, is the graphic representation of geological formations being drilled through, and drawn on a log called a mud log. As the cuttings are circulated out of the borehole they are sampled, examined (typically under a 10x microscope) and tested chemically when needed.
Petrology utilizes the classical fields of mineralogy, petrography, optical mineralogy, and chemical analyses to describe the composition and texture of rocks. Modern petrologists also include the principles of geochemistry and geophysics through the studies of geochemical trends and cycles and the use of thermodynamic data and experiments to better understand the origins of rocks.