Consider using 74192s cascaded, which are programmable Up/Down counters (or equivalent). Use a light source (visible or IR) set up using a comparator like a LM339 to generate the clock pulses that drive the counter.
**broken link removed**for an understanding of comparators like the LM339, **broken link removed**to understand the 4017 counter chip. The 4017 will drive a 7447 seven segment display driver.
All of the chips are merely suggestions for a starter. Since your request is vague the options are a little vague also. Is this an industrial project, school project or what?
Ron