Sayeth the animated, wraithian lab coats at Evil Mad Scientist Laboratories (think: Santa’s worshop, only for Halloween, and evil!):

Here’s an inexpensive electronic circuit that you can build to put in your Jack-o’lantern. It provides power to drive a few LEDs at night, and automatically turns them off during the daytime. It’s a simple and automatic dark-detecting circuit that you can use to for your very own photosensitive pumpkin.

A dark detecting circuit for your jack-o’-lantern