Picatinny Rail is an informal name for the U.S. military standard MIL-STD-1913. This standard defines the mounting system for attaching accessories to small arms. It is called the Picatinny Rail because it was formally tested and approved for military use at the Picatinny Arsenal in New Jersey. In order to design attachments for firearms and to be sure that such devices will be able to mount properly onto whatever weapon that the user might wish to apply them, it is necessary to have a defined standard mechanism for mounting devices to firearms.
At its most basic, the Picatinny Rail is a metal 'track' or 'rail' consisting of a series of T-shaped wedges set in a standing line (they are T-shaped in cross-section). The T shape provides a means for the accessory to hold itself securely to the rail, as it will usually have a matching slot or set of grips which clamp underneath the edges of the T-shape. The dimensions of these T-wedges are very specific*. In between the wedges are slots which are used for two purposes. The acessories which slide onto the rail by gripping the T-caps that are its upper edge can extend clamps or other mechanisms into these slots in order to lock themselves in place along the rail. They are sometimes called recoil slots since their purpose is to give enough purchase to allow attachments to remain solidly connected despite the front-to-back (along the rail) shock of recoil. In addition, the slots allow the rail to expand and shrink as the weapon heats or cools in response to both the environment and use.
Originally designed for the attachment of telescopic sights, the Picatinny Rail is now used for all manner of gear including (but not limited to): scopes, laser sights, tactical lights, night vision devices, grenade launchers, reload holders and more. Although it was originally only intended to be installed atop the barrel of a weapon, modern assault weapons (especially those used by special forces and SWAT) sometimes come with rails on all four sides of the barrel - top, bottom, left and right - in order to accommodate the plethora of attachments the modern warrior might find useful. For an example of this, see the Heckler & Koch 416 pictured at that link. The rails are clearly visible, with the rear sights attached to the top rail.
________________
/ \
<-left \__ __/ right->
| |
| |
----------------
Picatinny Rail cross section
|--slot-|
V V
__________________________________
| | | | | | | | |
<--back | | | | | | | | | front-->
|____|__|____|__|____|__|____|____|
^ ^
|-------|---wedge as above viewed from top
Picatinny Rail top view
* The precise specs of the rail can be found
here.