What is the foam stuff that semiconductors come in?
The black stuff is a rubber and/or plastic foam that is heavily loaded with elemental carbon (graphite) in order to make it conductive. It keeps the pins effectively "shorted" together (through a resistive path), and if it's sitting on a grounded surface, it also provides a current-limited path for ESD currents, helping to prevent damage to the parts.

It's cheap and effective for short-term storage, but I've found that over long periods of time, it can break down and/or absorb moisture and corrode the leads of parts that are stuck into it.