A lava lamp has a light bulb in the base. The bulb puts out light and heat. When you first turn on the lava lamp after it's been off for a while, the colored wax at the bottom is a solid. The first step that occurs is the heat from the bulb melts the wax and turns it into a liquid. Without the wax becoming a liquid first, no "lava" action can occur,
As the wax heats up, it becomes a liquid. Hot wax is slightly less dense than the clear oil, so it rises to the top of the oil. When the wax cools down, it falls to the bottom. The cycle of heating and cooling repeats itself, causing the rising and falling motion of the liquid wax. The temperature difference between the hotter wax and the cooler wax is only a few degrees. Both hotter and cooler states are still liquid, but the wax that rises is just slightly hotter than the falling wax, which is cooler.
The light bulb also puts out light. A lava lamp will work as long as a heat source is present to melt and move the wax, but you can't see it clearly. The bottom of the bottle is clear, so it allows light to shine through. The light reflects off all the surfaces, so you can see the "lava" effect clearly.
If you watch a lava lamp, notice that air pockets sometimes get trapped inside the wax. This is a normal part of operation. If an air pocket develops, the wax rises very fast. This is because the bulb is heating both the wax and the trapped air at the same time. The fast rising wax adds interest to the effect because the wax will rise at different rates. Some parts rise slow, while others rise fast.