2D Shadows Via Shader
Here is a link to a very good article on implementing a 2D shadow mapping system. Also see here for a slightly different version.
These techniques have the advantage of working on all 2D objects, even those with complex shapes as a result of transparency in their textures. These versions are reliant on fragment shaders but if you are working with opengl or directx this should not be a problem.
These techniques also have the advantage of being very efficient and only scaling with the screen resolution. In other words; increased image complexity will not result in a change in performance.
2D Ray Casting
Some other techniques are more akin to ray casting. The link posted by Roy T. is an excellent example.
Often these techniques involve casting rays towards vertices of scene geometry to test visibility, but sadly they require that all shadow casting objects have a geometric definition. Luckily this is often a requirement anyway since many games feature a physics engine which has a similar requirement and so there are plenty tools to help create these definitions for your art assets, such as this.
A further drawback to this form of 2D shadows is that its complexity scales with the scene geometry complexity. Adding more objects to the scene means, not only more vertices to test the visibility of, but also more objects to detect ray collisions with. So unlike the technique above, you may find that this technique limits your scene budget.
There are, of course, some very good reasons to use this method. Firstly, you may have actually already have most of the main functionality required or are planning to implement it for other reasons; efficient ray/edge intersection testing and 2d object geometry as an edge/vertex list. Secondly, you may find that for your typical scene or the rendering system you happen to be using that this method is more efficient than the shader based shadow mapping. As always, picking the technique is entirely based on why you want to use it.
As a little extra that doesn't really address the question - if you fancy a simpler, hackier method and you are lighting an appropriate tile map based scene (or just one with a really low resolution) you can always try light propagation. Use Bresenham's Line Algorythm to cast rays out along the tile map from the light source until you reach a non-empty cell, reducing the light contribution at each step.