There's a really nice write-up on this topic on Black Bear Coffee's website (which Aaronut linked above).
Though it's not mentioned in your question, oxygen is actually the first culprit in loss of freshness:
Separation from oxygen has been the primary strategy, with good
reason. Oxidation obviously contributes significantly to flavor
degradation and loss. Ambient air contains 19-21% oxygen and only 14
cubic centimeters of oxygen (or 70 cc of ambient air) are enough to
render a pound of coffee dead stale....A common myth is that coffee is not able to take on oxygen immediately after roasting due to carbon dioxide degassing. However, Michael Sivetz estimates that instead of 21%, about 10% oxygen surrounds degassing coffee –certainly enough to initiate oxidation.
The article doesn't specifically mention the effects of light on the freshness of coffee, so I would assume that light's role is mostly related to increasing thermal energy.
The common thread in all deterioration processes is thermal energy.
The rate of staling will be a function of the thermal energy applied
to the coffee and how it is distributed. An important mechanism of
thermal energy distribution is moisture. Roasted coffee will also
absorb water at any time it is exposed to humid conditions, especially
in the presence of high temperatures. Water quenching can add
additional water and some of the deterioration processes themselves
create water as a by-product. Within whole bean or ground coffee,
water will take one of two forms: free or bound.
"Free" water is mobile and can increase staling processes by retaining
and delivering thermal energy and oxygen to the aromatics, acids, and
oils, or bringing together sugars and protein to initiate
non-enzymatic browning. "Bound" water (bound to surfaces) is not as
mobile or available to solvate reactants. The ratio between free and
bound water is called "water activity." It is increased any time the
coffee comes into contact with humidity or high temperatures ("bound"
water often becomes "free" water upon heating). A relatively low
ambient humidity of 25% can cause roasted coffee to increase its
moisture content to 5%, with water activity also increasing. Lipid
oxidation is accelerated at heightened water activities, but is not
usually measured in coffee, despite its effect on freshness. Studies
show that a water activity ratio of above 0.5 contributes
significantly to increased rates of non-enzymatic browning and lipid
oxidation. More studies on water activity and its relation to coffee
freshness are currently being conducted.
"Freshness" does indeed appear to be a subjective term, so I'm not sure there's a canonical definition about the chemical components of freshness. The Black Bear does provide an example, though: "Coffees known for their delicate and sweet aromas (such as certain East African coffees) depend on aldehydes for their unique flavor and are not good candidates for open bins or ground sales."
Other sources allude to the chemical components of coffee's taste but do not always enumerate them or distinguish "freshness" from the overall "coffee"ness. Here's one such statement from a reprinting of an article that appeared in Chemical & Engineering News:
A thousand volatile compounds have been identified in coffee, though
just 40 or so of these substances "have been demonstrated to
contribute to the alluring smell," Hofmann noted. They include
β-damascenone (which has an aroma like cooked apples), 2-furfurylthiol
(sulfury, roasty), 2-isobutyl-3-methoxypyrazine (earthy), guaiacol
(spicy), 2,3-butanedione (buttery), and
4-hydroxy-2,5-dimethyl-3(2H)-furanone (caramel-like).
The flavor and aroma compounds derive from multiple chemical
reactions, including the Maillard reaction, caramelization, polyphenol
degradation, polymerization of carbohydrates, and pyrolysis.
The closest I could find to someone identifying the chemical compound responsible for "freshness" is further along in that article:
"Unfortunately, the pleasant fresh-coffee aroma cannot be simply
preserved," Müller said. Once again, it's the sulfury-roasty aroma
quality that suffers during storage of coffee beverages. "This is
mainly due to the decrease of the coffeelike-smelling compound
2-furfurylthiol (FFT)." [said senior scientist Christoph Müller.]
The findings of this article reiterate Black Bear's claim that water activity is responsible for loss of freshness, and these processes are actually determined at the time of roasting as much as the storage conditions you have after you purchase your beans.
Once beans reach the desired degree of roast, they are cooled rapidly
with air or water. Air-cooled coffee beans contain just 1–2% water,
while water-cooled coffee beans contain as much as 5% water.
Baggenstoss studied the effect of the beans' water content on the
stability of flavor compounds during storage. He found that aldehydes,
pyrazines, and diketones such as 2,3-butanedione were unaffected by
bean water content.
On the other hand, compounds such as dimethyl trisulfide formed faster
and reached higher levels in beans with higher water contents.
Dimethyl trisulfide is formed by the oxidation of methanethiol, which
is broadly related to the perception of coffee freshness. "Therefore,
the coffee with higher water content seemed to lose fresh attributes
faster than air-quenched coffee," Baggenstoss said. Furthermore, "some
of the impact compounds are more rapidly degraded during storage of
coffees with higher moisture content."