Training for a marathon is largely dependent on your long runs. First, the definition of a long run is basically running for a long duration at a steady pace and every week or so, you slowly add on distance/time to your long run. The object of the long run is to finish it, so speed should not be the goal- unless you're an experienced marathoner and training to set a PR (personal record).
During long runs, you not only train your body to get used to running for long durations but you actually train your entire system to use calories and fat efficiently as well as sweating efficiently. The more long runs you complete the more you train your entire body (and mind) to complete 26.2 miles on marathon day. Also, eating and drinking through your long run is important. Many of us, get sick to our stomachs by ingesting food or fluids during running. I love the "Ultra Gatorade" especially made for endurance athletes. This has really helped me. But the more you practice this during your long runs, the more prepared you are for race day.
I cannot emphasize enough how crucial the long run is to your confidence. Running a marathon successfully is about mental preparedness as well as physical stamina. Many marathoners feel as though you can finish a marathon if you "think" you can. A lot of this has to do with how successful you feel that your long runs are.
Beginners, depending on their running experience, usually start their first long run with a 60 minute slow run. This is not about mileage completed, but the time spent running. Initially, this is done once a week. Personally, Saturdays are my long run days. Every week you will slightly increase your time spent completing your long run. For example: Week1: 60 min, Week2: 70 min, Week3: 80min, Week4: 90 min., etc. Once your long run reaches 1:45 min, some runners feel more comfortable completing their long runs every 9-14 days. This ensures proper rest and recovery and lowers the possibility of injuries. But others, like me, complete long runs every single week right up to 3 weeks prior to marathon day. Your last long run should not be any more than 20 miles or 3 hours. Running more than this may cause an injury before your big day. Also, if you are a beginner, you may run the risk of not being able to recover properly before the marathon.
Also, please stretch after your long runs and maybe before you go to bed as well. Your legs will thank you.
Rest, rest, rest is the key the 2-3 weeks prior to the marathon. You can run during these last weeks but you should be dramatically decreasing time spent running as well as intensity. The last thing you want to be feeling at the start line, is tired!
p.s I posted the picture above because I have to mention how tough the San Fran Marathon was (a lot more challenging for me than the Boston Marathon). Yikes, I remember like feeling I was going to tip backwards running those steep hills (smile). What a brutal course!!