Magnesium is used for a number of application, most common being, its use in incendiaries and as switch in thermites. It ignites easily in air and generates bright light, and hence is used in fireworks, sparklers, etc. Magnesium has two third the density of aluminium and is very easy to form alloys. Two commonly used alloys are duralumin and mangalumin. It is also very to work with and can be easily cast, welded, machined, etc. It is used in making light-weight components in automobile industry (car seats) and aviation industry (jet-engine parts, luggage frame, rockets, missiles, etc.). It is also used in laptops, cameras, etc. Magnesium oxide is used for making fire-resistant bricks for fireplaces. It can also be used for preventing corrosion of iron and steel in pipes and ships.
Hope this helps.