Octane is but one of many hydrocarbon molecules, including methane, heptane, et al.
From wikipedia:
"The octane rating is a measure of the resistance of gasoline and other fuels to detonation (engine knocking) in spark-ignition internal combustion engines. High-performance engines typically have higher compression ratios and are therefore more prone to detonation, so they require higher octane fuel. A lower-performance engine will not generally perform better with high-octane fuel, since the compression ratio is fixed by the engine design.
The octane number of a fuel is measured in a test engine, and is defined by comparison with the mixture of iso-octane and normal heptane which would have the same anti-knocking capacity as the fuel under test: the percentage, by volume, of iso-octane in that mixture is the octane number of the fuel. For example, gasoline with the same knocking characteristics as a mixture of 90% iso-octane and 10% heptane would have an octane rating of 90. <1> Because some fuels are more knock-resistant than iso-octane, the definition has been extended to allow for octane numbers higher than 100."
http://en.wikipedia.org/wiki/Octane_rating