Connecting an 8 ohm speaker to Arduino

To drive an 8? speaker you really need a power amplifier.

The simplest form is a transistor with base bias resistors and a capacitor to decouple the DC offset of the Arduino's signal.