Copper produces blue sparks. Barium, also used in rat poison and glassmaking, makes green. A mix of strontium salts, lithium salts and other stuff makes red. Aluminum and titanium put the white stars in an aerial flag. Image

Fireworks for the 4th of July are all about light, color and sound. But inside, there are some bizarre ingredients, from aluminum to Vaseline and even the stuff of rat poison.

An ancient mix of black powder, essentially gunpowder little changed from its invention in China a millennia ago, gets each rocket in the air by creating pressure in gas trapped in a tube, or mortar.

Two fuses are lit at once: one to ignite the black powder, and another that burns slower, creating a well-timed explosion high in the sky.

The shells of commercial fireworks contain a powdery concoction of chemicals that produce the bangs and the whistles, as well as the pretty effects. Tubes, hollow spheres, and paper wrappings work as barriers to compartmentalize the effects. More complicated shells are divided into even more sections to control the timing of secondary explosions.

Big booms and whistles come from flash powder. Once used for flashes in photography, it is a combination of fuel-like metal and a chemical that feeds oxygen to fire up the fuel.

Different combinations of metals and oxides produce a whole array of sounds.

While ancient Greeks and Romans used bismuth in their beauty care products and coins, chemists add bismuth trioxide to the flash powder to get that crackling sound, dubbed "dragon eggs." Ear-splitting whistles take four ingredients, including a food preservative and Vaseline.

The variety of color in a fireworks show depends on the mix of metals.

Copper produces blue sparks.

A mix of strontium salts, lithium salts and other stuff makes red.

Aluminum and titanium put the white stars in an aerial flag.

Barium, also used in rat poison and glass making, makes green.

Calcium burns orange and sodium, yellow.

In recent years, chemists have worked to develop more environmentally friendly fireworks, in part because one ingredient, perchlorate, was found in higher than normal concentrations in a lake where fireworks were shot off, and the chemical is known to cause thyroid problems in humans.

Meanwhile, to light up a red, white, and blue flag, chemists can lay out the emblem's design on wax paper. The pattern you see up in the air, whether it's a smiley face or a bow tie, mirrors the arrangement of the metals in the shell.

Because the flag, or any other pattern, shoots out from the shell as a two-dimensional image, people watching the show from different angles can't always tell what they're looking at. To make sure everyone has a good view, pyrotechnists tend to send duplicates into the sky at the same time.

You can see fireworks before you hear them because light travels faster than sound.