TeX is a computer programing language written in the 1970s by Donald Knuth and designed to facilitate the typesetting of mathematics. The best feature of TeX is its license, the GNU Public License, which allows for others to use and improve it without cost.
TeX is actually a compiler, and takes an ordinary text file as input. This allows for implementations of TeX for all major operating systems. I have found MiKTeX, a free system for Windows, to be my favorite, primarily for its combination of price, documentation, support, and on-the-fly installation of TeX extensions.
In addition to the text file, however, TeX also requires a set of predefined variables, such as the intended page-size and font to be used. This means TeX can be used to great advantage when standardized output is required (for example, for a scientific journal that wishes to format each of its articles the same way, or for a business letter on letterhead). However, this also means that any changes to the default output format must be programmed by the user. For those without the time or inclination to learn how, the result is the many PDF files found online, and even many textbooks from major publishers, with mathematical writing using the Computer Modern font, ridiculous margins (designed for journal articles printed on smaller paper), and tight single-spacing. So common has this become that there are those who claim a paper or book doesn't look professional unless it has these properties. The ironic result of TeX has been beautiful equations in ugly books.