Science behind it (this might not be super correct but it is my basic understanding of how it works): As the motor vibrates (uses an imbalanced shaft) it transfer the kinetic energy into the foam which has many air pockets throughout its structure. As the foam absorbs all this kinetic energy into all the air pockets it spreads out the rough vibrations throughout into little air vibrations everywhere within the foam and smoothing it out. All the air pockets now vibrate at the same frequency and each acts as a small speaker using compression of air to produce sound. Think of it like a 100 little piezo speakers all playing the same song tied together on a hammock, this is essentially what the foam is, lots of little air pockets connected on a web which allows many of them to vibrate almost independently.
Arduino (uno used for this) and jumper wires
Vibration Motor (Radio Shack http://www.radioshack.com/product/index.jsp?productId=2914700)
LED (not necessary but fun)
1″ x 3″ of Foam (can try many different materials here) (http://tinyurl.com/9b6cohq)
Small piece of scotch tape
Step 1: Wrap vibration motor with foam
The motor and LED are wired in parallel so they receive the same outputs from the Arduino for the music. Pin 9 on the Arduino is what outputs the music signal so that will be the lead to the positive for the LED and motor. Both the negative leads on the LED and motor will goto ground. Plug in the components into a breadboard (or wired together directly if desired) following the pictures and schematics.
*Note: Depending on what LED is used, a resistor may be needed (but will probably not burn out without it)
Wiring diagram courtesy of Arduino example projects (Great resource, check it out!) http://arduino.cc/en/Tutorial/Tone
Step 3: Upload code and play vibrational music!
Last step is to upload the code (currently has Star Wars theme and Mario themes, remove commenting on the mario theme and comment out the Star Wars theme to play different melodies).
For more detail: Vibration Foam Speaker