As mentioned above there might also be some limitations as to the form of light you can use on your bicycle and one of probably the most common restrictions is that the sunshine must be 'steady' in place of flashing. You will find that most modern LED lights have a steady mode as well as a flashing mode but you may also find it beneficial to have two lights mounted. One steady to meet the legislation and one flashing to make you more visible. Some rear lights come with multiple banks of LEDs that allow you to have some showing steady and some flashing.
Most rear cycle lights mount on the seat pillar but there are also some that mount on the bicycle frame. You need to ensure though that wherever you mount your cycle light that is conforms to local egislation as there are, in most countries, minimum height from the ground requirements as well as other requirements. For example it might also be illegal to use flashing strobe type lights although they now seem to be more and more widely accepted.
So if you are in the habit of riding your bicycle at nighttime, make sure you are safe by fitting adequate lighting to the rear (and front) of your bike, and remember that whatever solution you go for when lighting up your bike it needs to conform to local legislation.
Rear lights on your bicycle essentially serve a single purpose. They make you more visible in low light conditions, whether that be at day or at nighttime and support to decrease the chance you are going to be inquisitive about an accident with another road user.
One word of caution is that although a flashing light tends to be more visible to motorists and other road users it truly is sometime difficult to assess the distance to them and there is a suggestion that if the driving force behind you is drunk they could actually be attracted to the flashing light. These caution notes though only really serve to backup the fact that you ought to have both steady and flashing lights on the rear of your bike.
The historic filament bulb form of cycle lamp turns out to have had its day now with more and more LED style lights coming onto the market with comparable vigor and usually more favourable battery life.
All About Cycling - Rear Cycle Lights