Ambien (zolpidem) is a prescription medication used to treat insomnia, and it is available in both brand-name and generic versions.