These following instructions will help to prepare and successfully write a standard .iso image to an external USB flash drive on a Apple Mac OS X from the command line.

Convert the .iso file into UDRW format image:

hdiutil convert -format UDRW -o ~/path/to/image.img ~/path/to/image.iso

List all physically attached drives and take a note of the one you will be using for writing. The device path you need is in /dev/diskN format.

diskutil list

Unmount the taget USB external drive, replace the /dev/diskN with an actual path of the drive:

diskutil unmountDisk /dev/diskN

Burn (write) the image to the USB drive:

sudo dd if=/path/to/image.img of=/dev/rdiskN bs=64k

Eject the USB drive before removing it physically:

diskutil eject /dev/disk2