The citric acid in lemon juice hydrolyzes the sucrose molecules into glucose and fructose as you heat the sugar. The water in the lemon juice is also part of this process. This mixture of monosaccharides is much less crystalline in the same way that most mixtures are less crystalline than pure substances. Wikipedia has a good article on this process under the title "Inverted sugar syrup". The syrup is "inverted" in the sense that the sign of its optical rotation has changed because sucrose has a large positive optical rotation while fructose has a large negative optical rotation. Glucose has a positive optical rotation, but of a lower magnitude than sucrose.
The reaction is:
$$\ce{C12H22O11}(sucrose)+\ce{H2O -> C6H12O6}(glucose)+\ce{C6H12O6}(fructose)$$
The reaction can occur to a small degree by simply heating sugar with water in absence of acid catalysis. I assume the acid is necessary to get good conversion before you burn your sugar or vaporize all of the water.
Honey is a naturally occuring inverted sugar syrup of this type. Honey is resistant to crystallization because it is a mixture of gluclose and fructose. Honey is also slightly acidic.