Can I re-cook a ham that was left out overnight?
It's probably even safe to eat without cooking again; the refrigerator is likely only about 10 degrees colder, and that generally translates to accelerating rates of spoilage (mostly growth of pathogens) by a factor of 3-5 or so.  For example. at 10C (50F), E. coli only manages to divide once every 8 hours or so (see Ratkowsky et al., "Relationship Between Temperature and Growth Rate of Bacterial Cultures", J. Bacteriology, vol 169, p. 1 (1982) for a not-very-clear example of growth curves--I've seen these curves online, but unfortunately I tried and failed to find an easily accessible one this time).

It's almost certainly safe to eat with cooking (fully, to at least ~160 at the center), which would kill anything that managed to grow on the ham.  The only thing to worry about with well-cooked food is whether bacteria or fungi have managed to produce so many toxic chemicals that the food will make you ill--and in this case, it's been too cold.  (At those temperatures, not only is growth slow, but most anything is slow, including production of anything toxic.)

So I'd say--cook away, enjoy, and don't worry about it.

P.S. I have in practice eaten ham left out at warmer temperatures for longer.



Edit: In response to a comment about bacterial toxin production, I want to reiterate that colder temperatures slow down metabolism of just about everything, including toxin production.  This is because, at a basic physical level, reaction rates are governed by the Arrhenius equation which translates, for simple reactions, to a doubling of reaction rates for ~10C increase in temperature.  Of course, organisms like bacteria have more complex interactions, but this still gives an order of magnitude estimate.  Furthermore, research has been done on production of bacterial toxins.  For example, Skinner &amp; Larkin (J. Food Protection vol 61 p. 1154 (1998)) wrote a paper called "Conservative Prediction of Time to Clostridium botulinum Toxin Formation for Use with Time-Temperature Indicators To Ensure the Safety of Foods", which gives, for food innoculated with the bacteria, a time-to-detection-of-toxin of 2-3 days at 10C.  In fact, they did the research because food storage at open-face refigerators in stores often allows products to get up to as high as 10C (at least as of 1998).

Similarly, in Bonventre and Kempe ("Physiology of Toxin Production by Clostridium botulinum Types A and B, III"), their 10-18C toxin line is flat for 24 hours at the baseline level before creeping up by a factor of 3 or so between 24 and 48 hours (figure 4).

These are just examples, but you find the same general trends everywhere because of the fundamental physical relationship between reaction rates and temperature.