Ballistic transport in periodic and random media