In linguistics, the comparative method is a standardized way to compare different languages in order to determine their relationship to one another. The comparative method is based on the principle of regular sound change, which holds that any changes in the sounds of a language that happen over time occur in a regular way, with no exceptions. Languages are analyzed using the comparative method to determine whether they share a common mother language, a single language from which several others evolve. The comparative method can also suggest which branches of a language family developed earlier or later in time.
Historical linguistics uses the language of genetics and familial relationships as an analogy to discuss the relationships between languages, so two languages that grew out of a single language - say English and German - are referred to as sisters, the daughters of a single mother language - in this case the hypothetical Germanic. Languages with common "ancestry" are grouped together into families. It is important to note that this is simply analogy, and does not mean anything about the genetic background of a language's speakers; an English speaker in the modern world is not necessarily a descendant of someone who spoke "Germanic".
The comparative method generally makes use of a large list of words with the same definitions in the languages being compared. Words that are likely to have native terms in each language are preferable, to prevent the confusion that could result from borrowed terms. The words are then compared to each other, and correspondences between sounds are noted. As an example, the f sound in German corresponds to the p sound in Latin at the beginning of a word: Latin pater ("father") has the same meaning as German Vater (pronounced Fah-tuh).
In the comparative method, the linguist records all correspondences between the languages in question, then sets about writing sound rules to explain the changes. A sound rule for the above example would account for how a single sound in the mother language became p in Latin and f in German. The location in a word of a sound correspondence must always be taken into account. Latin p, for example, only corresponds with German f at the beginning of a word.
When one is comparing two or more sister languages, and no record of a mother language exists, the linguist can use the comparative method to reconstruct a hypothetical mother language. One of the most well known and thorough of these reconstructed languages is Proto-Indo-European, from which hundreds of European, Middle Eastern, and Central and South Asian languages have evolved, including the above examples of Latin and German.
Because the rule of regular sound change stipulates that there are no exceptions to a sound change rule, anything that looks like an exception must be investigated and explained in a way that satisfies linguistic principles. An apparent anomaly may be due to the effects of another sound change rule or to the chronological order in which multiple sound changes occurred, or it may appear because the word in question entered the language after the sound change took place. After determining the sound change rules for a set of languages one is investigating, the next step in the comparative method is to determine the order in which the sound changes occurred. This step is where those things that seemed to be exceptions to the postulated rules can come in handy.
As you may have surmised, the comparative method can be a complicated and lengthy process, and sometimes an educated guess is the best conclusion one can come to. Nevertheless, the comparative method is an indispensable tool for historical linguists and responsible for nearly all currently accepted language genealogies.