There are lights available - are spotlights, as some say - that are electrically powered from the house or those that are battery powered and often equipped with solar cells to charge the batteries during daytime.
How it operates:
As said already, when equipped with solar cells or panel, it turns the sunlight into energy that is then stored in rechargeable batteries, during daylight hours.
Now, when the motion sensor detects a motion at night, it will turn on the light. To not turn on the light during daylight when a motion is detected, the device is equipped with a photocell. This makes it possible that the device only lights up at night.
It is advised to only use the socalled "AA" Ni-MH rechargeable batteries.
Best place for the solar panel is in an area where it - during daylight hours - will receive the maximum amount of sunlight. Remove objects that could block the sunlight. Don't use the light immediately after installing, but take a few days for the solar panel to charge the batteries.
Heat producing sources should also be avoided in order to prevent false triggering. Same goes for water, flue vents, air conditioners, barbecues, white walls and windows. One should also avoid having the device near trees and street traffic.
An example of a motion sensor light is Sunforce 82156 - 60 LED Solar Motion Light: www.home--garden.com/led-lighting/sunforce-82156-solar-motion-light.shtml