Basically, a lava tube is formed when a underground lava flow stops flowing, leaving behind a long tubular cave.

>**A lava tube is a natural conduit formed by flowing lava which moves beneath the hardened surface of a lava flow.** Tubes can be draining lava from a volcano during an eruption, or can be extinct, meaning the lava flow has ceased and the rock has cooled and left a long cave.

>**Lava tubes are a type of lava cave formed when a low-viscosity lava flow develops a continuous and hard crust, which thickens and forms a roof above the still-flowing lava stream.** Tubes form in one of two ways: by the crusting over of lava channels, and from pāhoehoe flows where the lava is moving under the surface.[1]

[Source][1]

This is what the lava tubes at [Mammoth Cave (Utah)][2] look like,

[![Mammoth_Cave_(Utah) lava tube][3]][3]
[![Mammoth_Cave_(Utah) lava tube][4]][4]
[![Mammoth_Cave_(Utah) lava tube][5]][5]


  [1]: https://en.wikipedia.org/wiki/Lava_tube
  [2]: https://en.wikipedia.org/wiki/Mammoth_Cave_(Utah)
  [3]: https://i.sstatic.net/aWN8r.jpg
  [4]: https://i.sstatic.net/drNCC.jpg
  [5]: https://i.sstatic.net/BLCw7.jpg