Bottles will always spawn containing a random liquid. In addition to holding liquids, bottles can also be dipped (using '!' command) into other bottles or cans to split the contents evenly, or into a nearby tile (fountain or lake) to fill them.
Bottles can also be used offensively, depending on their contents. A weapon may be dipped into a bottle to coat it with the liquid inside, allowing one to inflict its effects on an opponent. Bottles can also be thrown to spill their contents when they shatter on impact, making it possible to remotely coat an opponent in poison, acid, or any other liquid from a distance.
Bottles can be converted to another material by a Scroll of Change Material but only the bottle itself is changed - not its contents. However, if a bottle is changed into a liquid and the bottle is then drunk, both the bottle and its contents are consumed at the same time and the effects of the bottle's main material are gained in addition to those of its contents. This is impossible to accomplish in the latest version, as you may only request a solid material when using a scroll of change material.