To all that have responded, I mean no disrespect, but some things said are really do not give the whole picture (no pun intended).
First, what is the difference between the 5D Mark II (refered to as the 5D II from here on) and the 50D (for simplisity I am assuming you mean the Mark II)?
Yes it has a bigger sensor, but what does that mean exactly. Using megapixels to determine image quality is a huge mistake made by many. It is not the number of pixels per se, it is the number in combination with the individual pixal size.
The 5D II not only has more pixals, but far larger pixals. This make the image way superior to lessor sensors.
The sensor size of the 50D is APS-C and the 5D is Full Frame. Basicaly, Full Frame means the sensor covers the same amount of physical space as a frame of 35mm film. The croping factor on the 50D comes from its smaller APS-C sized sensor.
Let me be very clear, none, absolutly none of the EF-S lenses will work with any Full Frame Canon Camera. They are specifically designed for the APS-C sensors. What happens is the glass on a EF-S lens sticks out farther and simply would hit the mirror as you open and close the shutter. All EF-S lenses have a white square insted of the red dot we use to line up lenses and lock them in place.
Second, there is a huge difference between the 40D and the 50D. There was little change worth noting from 30D to 40D, at least from a technology stand point.
Both the 5D II and the 50D use the DiG!C 4 chip as opposed to the 3. Both use 14 bit A/D (that stands for analog to digital conversion). The chip provides faster processing and the 14 bit, as opposed to the 12 bit, provides far better tonal gradiations (less noise at higher ISO's).
Now I could write pages on the differences between current and earlier models let alone two current models, but the real question should be addressed by determining your needs.
You want a lighter and faster fps (frames per second) all while spending less money; the 50D is your best choice. If you are will to sacrifice the fps speed (I should say is is realativly minimal; look at the 1D Mark III!) and need a more rugged camera, the 5D II is your best choice.
Either way, you won't be dissatisfide. Canon makes amazing cameras which in turn provide a tool for great pictures.
If you have more specific questions, just let me know.
-Nick