It turns out that before we arrived at the current standard design of little red-tipped things that you strike against the side of a box, there were a lot of earlier designs, many of them positively frightening. Obviously, a portable and reliable way of making fire is extremely useful, and for a long time, the standard way of doing so was a flint and steel. This works pretty well, if slowly, if you want to light an actual fire, but it doesn't work if you just want to light a candle, or pipe, or cigar.
As with so many technological ideas, China got there first, and had simple sulfur matches by the 6th century. In Europe of the late 17th century, the discovery of phosphorus' flammability soon had people experimenting with a chemical means to make fire, initially without much success. The first "modern" match was invented in 1805 France, but its mechanism of action was truly terrifying: to ignite the match, you dipped its head into a small asbestos bottle filled with sulfuric acid!
Needless to say, this first match did not become very popular. Later, slightly saner designs inverted this and put the phosphorus into the bottle and the sulfur onto the match head.
Two decades later, in London, a "match" was patented that consisted of a coated glass capsule wrapped up in a roll of paper. When crushed with a pair of pliers, the capsule would ignite. Simple! Later on, wooden matches for lighting cigars were created that had a small bulb of sulfuric acid at the tip to ignite the match.
With the chemical match an unpopular and dangerous dead end, other inventors turned to the idea of using the heat of friction to ignite a match. Again, an early design came from France, in 1816: a sulfur-tipped match that was scraped against the inside of a tube coated in phosphorus. Finally, in 1826, the first friction match that could simply be struck against sandpaper was created. An improved formulation called the "Lucifer" went on sale in 1829. Its initial reaction to being struck was violent, its flame unsteady, its smell foul, but it was still a marked improvement.
Finally, in 1830, the white phosphorus match was invented. Now, you might know white phosphorus as the truly terrifying incendiary weapon capable of burning up and suffocating its victim. But back in 1830, that's what they used to light their cigars. White phosphorus matches had to be kept in airtight containers for safety, but nevertheless became popular and remained so for the next half-century.
As time went on, evidence accumulated that the manufacture of white phosphorus matches caused bone disorders such as "phossy jaw" in workers. The matches were also very toxic and caused quite a few deaths from ingestion. In 1850, the much safer red phosphorus was discovered, and quickly led alternate match formulations being created.
Finally, in the 1850s, something like the modern safety match was introduced: well-behaved, comparatively nontoxic, and only strikeable on a special abrasive surface incorporating red phosphorous. But it would take until the 1880s for white phosphorus matches to be pushed out on health concerns, mostly because the safer red matches were much more expensive. Finally, in the late 19th and earliest 20th century, most industrialized nations proceeded to ban white matches.
So remember: don't play with matches, but know that it could be so much worse.
1 Pretty much this entire post is taken from the Wikipedia page on matches.