I have an app called Trailguru on my iPhone. It's free, and you can upload your run/ride/hike/whathaveyou and track your activity.

I haven't used it on rides longer than two hours, but I imagine it could go through your battery pretty fast . . .