At the end of the very last episode, Walter picks up Todd's phone and answers Lydia's call. He tells her that he poisoned her with ricin.
Why did he do that? Knowing that she'd been poisoned, Lydia could get medical help and survive the poisoning.
Ricin is extremely toxic. It has an LD50 (the lethal dose for 50% of people exposed) of 30–40mg per kilogram when ingested (its much much more dangerous when introduced to the body in other ways). Guessing Lydia's weight at around 50kg (110 lbs) would lead one to think the LD50 would be no more than 2g of ricin.
It has a military-developed antidote, which has had only limited trials in humans. Ricin is a chemical subject to the Chemical Weapons Convention, in the same schedule as nerve agents Sarin and VX. (All this information gleaned from Wikipedia)
Walt also only told her when she'd already begun to experience symptoms, so less likely to recover even if treated. Even if she sought attention and gave them this information it seems unlikely that she would recover. Even if she's not been given a lethal dose, survivors of ricin often suffer from long term organ damage, so she would have a pretty miserable and presumably shortened life even if she does survive.
I think Walt probably weighed her slim improved chances of survival, against the pleasure of knowing that she was aware who had done this to her.
I considered an answer like @Keen's too — perhaps she would not go to a hospital in fear of the attention, but I think this is less likely, even the risk averse would put fear of death above prison.
Ricin poisoning, particularly in a dosage designed to be fatal, is almost always fatal. Look what happened to Brock, and that was a controlled dose of Lily of the Valley: Significantly less potent.
Walt waited long enough for the Ricin to gestate inside Lydia (which wouldn't have taken long at all); Walt is nothing if not meticulous about 'the little details'.
He told her because he wanted her to know she was going to die, and that she was killed by his hand.
Perfect revenge, all Lydia could do was spend the last moments of her life smothered by the fear of inevitability.
She could not get medical help, and this is why Walt told her. By telling her that he poisoned her with ricin, this meant she would not be willing to seek medical attention, since this would attract police attention (see what happened with Jesse told doctors that Brock was poisoned with ricin). She's extremely risk-averse and would never want to attract the attention of the police. Ergo, by telling her that it's ricin, Walt knows that this dooms her to die without getting the medical help that would save her from dying, but doom her to prison.