This guide page is worth studying.
Using AppendTo
m = 0;
result = {};
Do[AppendTo[result, m = m + r[[i]]], {i, 1, Length@r}];
result
(* {0, 1, 5, 8, 9, 12, 16, 24} *)
Using Sow and Reap, which is more efficient than AppendTo.
m = 0;
Do[Sow[m = m + r[[i]]], {i, 1, Length@r}] // Reap // Last // First
(* {0, 1, 5, 8, 9, 12, 16, 24} *)