Explanation of Lemon Juice-Invisible Ink
Lemon juice works as a sympathetic ink partially due to its caramelization, as @Mithoron profoundly noticed -- especially upon extreme heating.
Recent review of the degradation process of lemon juice [1] suggests that browning of lemon juice is associated with 3 processes:

ascorbic acid degradation;
Maillard reaction;
caramelization.


One of the first in-depth investigations revealed the major role of ascorbic acid degradation referring to the browning phenomena [2]:

Compared with other fruit products, lemon juice contains few natural pigments to mask.
...
Because of the high acidity (pH 2.5) of this product, it was unlikely that browning was due to sugar-amine condensation and the results showed that ascorbic acid was the main precursor. Browning of lemon juice and model systems was proportional to the level of ascorbic acid; the presence of amino-acids in model systems increased the intensity of browning.
The principal role of amino-acids in the non-enzymic browning of fruit products appears not to be in the initial reaction leading to the formation of reactive compounds, but to increase the browning potential after the oxidation of the ascorbic acid to reactive carbonyl compounds. Thus, the pathway for the build-up of carbonyls depends on the pH and nature of the product, but in all cases the formation of melanoidin complexes originates from the polymerisation of carbonyl and $\alpha$-amino-groups.

It was also confirmed that the $\alpha/\beta$-unsaturated carbonyls are potent browning agents and also that dicarbonyls of the glyoxal type make a contribution to browning in the early stages.
More recent investigation at elevated temperatures (up to $\pu{120^\circ C}$) also supports the major role of ascorbic acid degradation among other factors of browning [3]:

Browning of clariﬁed cashew apple juice was caused by the degradation of ascorbic acid. Changes in the absorbance at $\pu{420 nm}$ and the ascorbic acid levels during thermal treatment of clariﬁed cashew apple juice were
described by ﬁrst order kinetics, showing the correlation between ascorbic acid loss and colour formation (browning).

It is concluded in all mentioned sources that formation of intermediate undesirable carbonyl compounds (mostly furfural and 5-hydroxymethylfurfural (5-HMF)) and various products of their polymerization and combination with amino acids (furfural is an aldehyde) upon heating is one of the major factors of browning.

Maillard reaction is a chemical reaction between an amino acid and a reducing sugar, usually requiring the addition of heat. The reaction is initiated by a condensation between the free amino group of an amino acid, peptide, or protein and the carbonyl group of a reducing sugar, leading to the formation of Amadori compounds (various furoylmethyl derivatives in case of fruit juices)[4].

Caramelization generally occurs at high temperatures (above $\pu{140^\circ C}$), when the juice is dehydrated and has high sugar content. Basically it is a pyrolysis and a final step of decomposition.

To sum it up, these are the products of first 2 processes (ascorbic acid degradation and reaction with amino acids (Maillard process)) (from [3], referred to as browning markers):

Bibliography

Bharate, S. S.; Bharate, S. B. J Food Sci Technol 2014, 51 (10), 2271–2288. DOI 10.1007/s13197-012-0718-8.
Clegg, K. M. Journal of the Science of Food and Agriculture 1964, 15 (12), 878–885. DOI 10.1002/jsfa.2740151212.
Damasceno, L. F.; Fernandes, F. A. N.; Magalhães, M. M. A.; Brito, E. S. Food Chemistry 2008, 106 (1), 172–179. DOI 10.1016/j.foodchem.2007.05.063.
del Castillo, M. D.; Corzo, N.; Olano, A. Journal of Agricultural and Food Chemistry 1999, 47 (10), 4388–4390. DOI 10.1021/jf990150x.