The ideal temperature range for fermenting lagers is of course yeast-dependent, but in general, you want to keep the wort temperature in the mid-40's (F). Since fermentation is an exothermic reaction (i.e., produces its own heat), then the surrounding air should be a little bit cooler (5-ish degrees F) than your desired fermentation temperature.
Ales, again, depends on the yeast. The thing is, ale yeast will LOVE warm temperatures such as in the high 70's to mid 80's F. It will ferment like crazy at those temperatures and finish up in a couple of days, producing a vigorous fermentation. However, they'll also throw off a ton of off-flavours. It looks impressive, but it will produce undrinkable beer.
In general, with ale yeast, you want a wort temperature in the mid-to-upper 60's F. So the ideal ambient temperature would be in the low 60's (since the fermentation will raise the wort temperature 5-10 degrees for ales).
The goal is to have a nice, controlled fermentation. If your normal-gravity beer is fermenting like crazy and blowing out the airlock and finishing in 3 days, you're likely fermenting too hot. Granted, some yeast are particularly enthusiastic, but in my experience, a "good" fermentation is one where I have a nice 2-3" krausen that never threatens the airlock, and falls back into the beer after about a week. That will minimize off flavours.