A ten-year-old vacationing in Wales stumbles across a lump worth nearly $6,000. A 67-year-old New York native receives a candlelike rock in the mail from her 80-year-old sister and discovers she may be $18,000 richer. All because a whale had a bit of indigestion.

That upset stomach creates ambergris, a rare substance that has been highly valued for thousands of years as an ingredient in perfume and pharmaceuticals. Ambergris originates in the intestines of male sperm whales after they dine on squid, whose hard, pointy beaks abrade the whales' innards. Scientists believe that the whales protect themselves by secreting a fatty substance in their intestines to surround the beaks. Eventually the animals cast out a huge lump, up to hundreds of pounds at a time.

But don't refer to it as "whale vomit"; scientists postulate that whales do not expel ambergris through their mouths. No one has ever seen a sperm whale excrete ambergris, although sperm whale expert Hal Whitehead of Dalhousie University in Halifax, Nova Scotia, admits that it is assumed the voiding takes place as fecal excretion, because when first cast out, he says, "Well, it smells more like the back end than the front."

Viscous, black, stinky blocks of freshly expelled ambergris float on the ocean's surface. Sun, air and salt water oxidize the mass, and water continually evaporates. It hardens, breaks into smaller chunks and eventually becomes grey and waxy, embedded with small black squid beaks. The weathered chunks exude a sweet, earthy aroma likened to tobacco, pine or mulch. The quality—and value—of any given chunk depend on how much time it had spent floating or otherwise aging, says expert ambergris broker Bernard Perrin, because "it ages like fine wine."

For thousands of years this sea treasure has been highly prized. Middle Easterners historically powdered and ingested it to increase strength and virility, combat heart and brain ailments, or to spice food and drink. The Chinese called it "dragon's spittle fragrance." Ancient Egyptians burned it as incense. A British medical treatise from the Middle Ages informs readers that ambergris can banish headaches, colds and epilepsy, among other ailments. And the Portuguese took over the Maldives in the sixteenth century in part to gain access to the island's rich bounty of the redolent stuff.

The Arabic anbar refers to this very whale-based substance and is the root of the word amber. Centuries ago the French employed amber gris and amber jaune (gray amber and yellow amber) to distinguish between animal-based ambergris and what today has become the standard meaning: the golden-hued vegetal resin.

Like other animal-based perfume components (such as musk) ambergris has a scent all its own—derived from its chemical component ambrein—that it imparts to popular perfumes such as Chanel No. 5. It also enriches the other olfactory notes of a perfume, much as salt enhances flavors and spices, and, most importantly, it prolongs a perfume's other scents. As odor chemist George Preti of the Monell Chemical Senses Center in Philadelphia explains, ambergris molecules are lipophilic (fat-loving), as are perfume molecules, but the ambergris molecules are larger and heavier. "The odor molecules have a high affinity for the other lipophilic molecules, so they stay associated with the ambergris molecules and don't go into the vapor phase all at once," Preti says.

American perfume companies no longer mix ambergris into their fragrances, most likely because of confusing legalities surrounding its sale here. Internationally, however, the trade is legal and Perrin has no problem finding French perfume companies to buy his stock. "We also sell it to a royal family in the Middle East and they use it as an aphrodisiac. Apparently they take some milk, some honey, and grind up small quantities of the amber and put that in as well," he says.

Many aspects of ambergris remain a mystery. Why is ambergris more commonly found in the southern hemisphere, though sperm whales range all the world's seas? Why is it only sperm whales—and particularly male sperm whales—that create it? How did ancient Middle Easterners decide to start using it for medicine, or decide that "eau de whale" would be a compelling fragrance?

Some, but not all, scent qualities of ambergris have been synthesized, so the original remains valuable. With sperm whale numbers down from the 1.1 million estimated prior to whaling to approximately 350,000 today, less ambergris floats on the seas. Still, Whitehead says the population is slowly recovering, and even though most findings turn out to be rocks or wax or other ocean detritus, beachcombers and fishermen continue to scour the sands and waves in hope of stumbling across a weathered chunk of this sea gold.