Ray casting is a technology used in many old ‘3D’ games such as Wolfenstein 3D,DOOM. Game engine use ray casting is also called a 2.5 D engine. The limitation of a simple ray casting engine in Wolfenstein 3D is that you can't look up or down – you can’t rotate X axis. Ray casting is fast and simple so before flash 10 which supports 3d, many people used this technology to make some 3D effect. Ray casting can easily create a maze-like world of walls. You can render terrains, too. Terrain rendering is much different from walls, it is also called voxel rendering.
Here are some information about voxel terrains and volume rendering:
http://bruce-lab.blogspot.com/2009/01/terrain-rendering-in-flash.html
Ray casting is different from mode7, mode7 is much more simple, good at rendering floors or grounds, but can’t do with walls.
I collected some good examples of flash based ray casting:
1.Wolfenstein 3D flash ported by Glen Rhodes
Flash ray engine
http://www.glenrhodes.com/wolf/
(2)old as2 version
http://recycle.andre-michelle.com/as2/packages.zip
You can find the source in ‘fla/examples/pro/raycasting’
http://git.runtimeterror.com/?p=rayfaster1.git;a=summary
3. Wolfenstein 3D in 20 lines of JavaScript by Mathieu 'p01' Henri (source available)http://www.p01.org/releases/20_lines_Castle_Wolfenstein/
4. JavaScript ray caster by Ben Joffe(source available)
http://www.benjoffe.com/code/demos/canvascape/textures
5.Flash AS3 Ray Casting Tutorial with example and source
http://www.rustyarcade.com/blog/read/33/Ray-Casting-Tutorial
6. UPDATE(2013-11-3)
Bresenham magic: raycasting, line of sight, pathfinding:
http://deepnight.net/bresenham-magic-raycasting-line-of-sight-pathfinding/
=============================================
UPDATE(2009-12-4)
rayfaster 2 test:
http://www.badsectoracula.com/peponi/rayfaster2/