Diesel Fuel Injection
One big difference between a diesel engine and a gas engine is in the injection process. Most car engines use a combination of port injection, which injects fuel just before the intake stroke (outside the cylinder), and direct fuel injection. Port injection is used at lower engine speeds because it has a more stable mixture of air and fuel. Direct injection is used at higher speeds to provide more power and less chance of knocking, which is when the air is compressed too much and the fuel spontaneously ignites.
Diesel engines only use direct fuel injection — the diesel fuel is injected directly into the cylinder.
The injector on a diesel engine is its most complex component and has been the subject of a great deal of experimentation — in any particular engine, it may be located in a variety of places. The injector has to be able to withstand the temperature and pressure inside the cylinder and still deliver the fuel in a fine mist. Getting the mist circulated in the cylinder so that it is evenly distributed is also a problem, so some diesel engines employ special induction valves, pre-combustion chambers or other devices to swirl the air in the combustion chamber or otherwise improve the ignition and combustion process.
Some diesel engines contain a glow plug. When a diesel engine is cold, the compression process may not raise the air to a high enough temperature to ignite the fuel. The glow plug is an electrically heated wire (think of the hot wires you see in a toaster) that heats the combustion chambers and raises the air temperature when the engine is cold so that the engine can start. Direct injection technology has advanced far enough that glow plugs aren't usually necessary for touching off the spark anymore, but many cars still have them anyway. Their heat helps burn the fuel more efficiently.
Of course, mechanics aren't the only difference between diesel engines and gasoline engines. There's also the issue of the fuel itself.