I'll qualify that I haven't heard the M50, but have spent time with both Bose headphones (so I'll talk about them):
- If build quality/durability is a concern, I would pass on them. The AE2 improves on the original in terms of overall durability, but they still feel somewhat fragile (they won't survive abuse).
- The AE and AE2 have relatively small ear-cups compared to most true full-size/around-ear cans, and this can make long-term comfort a concern depending on your head size, ear size, etc. They also seem to heat up with use (but I've heard the same about the M50).
Those negatives aside, I think they're one of the better sounding headphones in their price range (there, I said it). They aren't giant-killers, and they aren't the final word in fidelity, but they're not bad at all. They have good sound-staging (something that is unfortunately rare in cheap headphones) and tonality, but aren't the most accurate thing. They're "happy" or "fun" and do alright with a wide variety of genres. Finally, my biggest complaint is how "live" the enclosures and cabling are - they're very microphonic, and this gets quite annoying. Overall I'd say they're "fair" for their price. Basically, build quality aside, they're not bad headphones at all (and this is overall, not against anything specific). If you dig around enough I'm sure you can find my review of the AE.
FWIW, here's measurements for both:
http://en.goldenears.net/index.php?mid=GR_Headphones&document_srl=11751
http://en.goldenears.net/index.php?mid=GR_Headphones&document_srl=10034
If you're able to spend a bit more, and are intending to use these at home (so isolation isn't an issue), I'd also consider the Ultrasone HFI-2400 and AKG 70x - the AKG's have less bass and less clamp, but both are very good (they have excellent sound-staging and separation, and are both well built). They do cost somewhat more though (and are both open). If you can't really stretch your budget, or need a closed can, I'd also suggest the Sennheiser HD 280.