It is a gas. The structure of a flame will vary depending on which part of the flame you are looking at. At the very base of the flame, oxygen molecules and vaporized fuel molecules will exist in an unburned state. As you go higher, the fuel and oxygen molecules will be dissociated and will begin to react with one-another. At this point, combustion is incomplete. Higher up, combustion is completed and waste gases are produced (such as water vapor and carbon dioxide). The light and heat generated by the flame are caused by the reaction energy of combustion. You can also tell which parts of a flame are hottest by their color. The blue portion of a flame is the hottest, whereas red will be coolest.
Technically, a flame does expand like a gas. You usually cannot see this. This is because as a gas expands, it gets cooler. When it cools enough, it will no longer produce visible light and it will be invisible. Thus, you can only see the parts of the flame that are hot enough to produce light.
Some people will say that fire is a plasma (and in some cases it is). However, I don't consider plasma to be a true state of matter. It is simply a variant on other states of matter. You can think of, for example, metals to be a form of solid plasma because of the electron "soup" and atomic "kernels" they are composed of. Essentially, they are ionized but have a net charge of zero.
You could have fire with plasma in it by burning metal such as magnesium, since the metal atoms are technically ionized. However, a substance does not need to be hot in order to be considered a plasma. As long as it's ionized, it'll do.