The EOS 50D has a "normal" ISO range from 100 to 3200, whereas the 40D had a range of 100-1600. The 50D range can be expanded to include ISO 6400 and ISO 12800, whereas expansion of the 40D range just added ISO 3200.
The reason why Canon (and other camera makers) offer a "standard" and "expanded" ISO range is twofold. First the "normal" range should give good results and low noise, whereas the "expanded settings" may be lower quality. However there is a more technical explanation. In the "normal" or "native" settings, ISO is determined by the gain of the analog amplifiers between the sensor output and the analog-to-digital converters. In the expanded range settings, the effective ISO is obtained by a digital technique which could be considered equivalent to "pushing" film. For example if ISO 1600 is the highest normal settings, then an ISO 3200 "expanded" setting might be obtained by under-exposing the sensor by one stop at ISO 1600 and then digitally processing the resulting image to increase the brightness up to a level that you'd expect from ISO 3200. Just like with film this results in somewhat lower image quality, noisy shadow detail and a small loss of dynamic range.
When comparing the noise in images from different cameras you have to be quite careful because just about all cameras apply some sort of digital noise reduction to images shot at high ISO settings. In fact even with all noise reduction functions turned "off", the camera may still apply some default level of noise reduction to JPEG images. Digital noise reduction can sometimes work wonders, but it can smear image detail if too strong - and at really high ISO settings it has to be strong because intrinsic image noise is so high.
The best way to look at the intrinsic image noise is to shoot RAW and make sure that all possible noise reduction functions are turned off (or at least at their minimum setting) before converting the images to JPEG. This is the way the following images from the EOS 40D and 50D were obtained. Note that these are 100% crops from the original images, so on most monitors would represent sections of a very large print, typically somewhere around 24" x 36".
As you can see, at low ISO settings noise really isn't an issue (remember these are equivalent to looking at a really large print from close up). Even at ISO 1600 noise isn't much of an issue. However you can see that noise certainly is an issue at ISO 12800! If you look closely you can see that the 50D images are slightly noisier than the 40D images at the same ISO setting. Again, these samples are derived from RAW files and processed in Canon's DPP software (v3.5 as supplied with the EOS 50D), with all noise reduction functions (for both chrominance and luminance noise) set to zero. They are as close as you can get to looking at the noise level at the sensor.
With some noise reduction applied, the 50D can show less noise then the 40D, but still maintain an edge in resolution as shown below:
The above images are 100% crops taken from test shots at ISO 3200, with "standard" noise reduction applied to the 50D image. You can see that resolution is still slightly better than that of the 40D and the noise level is lower.
Next here's a 100% crop from a shadow area in an image shot at ISO 12800, first with all noise reduction off (RAW file converted with NR set to zero) and then with the "Standard" noise reduction setting. As you can see, noise reduction is quite effective.
Dynamic range is related to image noise because high levels of image noise mean that you lose information in the deep shadows. Dynamic range is basically the range in stops between something that doesn't record as absolutely black (0) to the level that's just below absolutely white (4096 for 14-bit depth). The noisier the shadows are, the more difficult they are to tell from the level you get with no light at all, and so the smaller the dynamic range of the shadows. Using noise reduction has the effect of increasing dynamic range somewhat.
I did not do any scientific measurement of dynamic range, but I did look at the deep shadows in a number of images (using standard noise reduction) and I didn't really see any significant difference between the EOS 40D and the EOS 50D. Perhaps there is a difference which could be measured in the lab, but it was not obvious from real world tests. That's not to say the 40D and the 50D have the same dynamic range, but rather to suggest that any difference that there is probably won't be seen by most users.
Though I didn't do a scientific evaluation of dynamic range, the Dxomark.com website has. DxO is probably the leading company in the digital camera measurement software business and a maker of one of the leading RAW image converters. Their measurements put the DR of the EOS 50D and EOS 40D within less than 1/10 stop of each other, at around 11 stops at the ISO 100 setting and 8.25 stops at the ISO 3200 setting. That would certainly be consistent with my own unscientific observations.