It kind of depends on what type of riding you like to do, but for general cross-country riding at 5' 10" I would usually recommend the Large size frame. With the Large, you can run a shorter stem to get the reach to the bars where you like it, (Most riders seem to like short stems these days) and the stand over height is the same as the Medium, so this is not an issue.
If you do a lot of technical riding (tight technical single track, log hops, etc.) and want a bike that you can "throw around" a bit easier go with the Medium. If possible, it is always best to actually sit on the size you are going to order, before you get it, just to make sure.