Okay, so, we usually define an infinite sum as the limit of the sequence of partial sums:
Sum(f(n), n=0..infinity) = lim_{N->infinity} [Sum(f(n),n=0..N)]*
whenever that limit exists. When that limit does not exist, we say the series diverges. And we don't really do anything with it. You may wonder if there is a consistent way to assign a value to Sum(f(n), n=0..infinity) in the case when the series diverges. This would, of course, not be the same as the limit of the sequence of partial sums, as that limit does not exist. However, the sequence of partial sums may still have some properties, even if it doesn't have a limit.
Basically (I don't know much about this, I'm just reading the wikipedia page), the Ramanujan sum relates the partial sum to an integral (of the function f) by considering the sum to be an approximation (Trapezoidal) to the integral. It turns out that the error of such a representation is fairly tractable. From this representation one can find some values associated with the partial sums, and one of those values is the one in question here (the -1/12 for 1+2+3+...).
It turns out that this isn't just random playing around, but actually has relevance. When you look at the function
thing(s) = Sum(1/n^s, n=1..infinity),
which is defined for all complex s with Real(s) > 1,
a theory of Complex Analysis says this has a unique extension to the entire Complex plane (except the pole at s=1). This extension is called the Riemann Zeta function Zeta(s), and we recognize Zeta(2) is a regular convergent infinite series with value Pi^2/6. But it extends to other numbers as well, like Zeta(0) and Zeta(-1). It turns out Zeta(-1) = -1/12. (I don't know how this is shown in full rigor, but these things are known.)
Well, we know Zeta(s) = Sum(1/n^s, n=1..infinity) for any s with Real(s) > 1. This does not hold when s=-1. However, Zeta(-1) = -1/12 is defined, and if we plug in s=-1 into the series on the right, it is exactly
Sum(1/n^{-1}, n = 1..infinity) = Sum(n,n=1..infinity) = 1+2+3+4+...
So when we say
1+2+3+ .... = -1/12,
this is an abuse of notation. What this really means is that -1/12 is the value at a particular point of a function that is the analytic continuation of a particular series, where that series, if you were to plug in the same point, would give 1+2+3+.... . You can't "plug in" the point since it is not in the domain, but it makes perfect sense to extend the function thing(s) that I wrote above to the entire complex plane (though it has a pole when s=1). So it's not completely bogus.
*So the sequence of partial sum for 1+2+3+... would be the sequence {1, 1+2=3, 1+2+3=6, 1+2+3+4=10, ...}, which is obviously divergent.