It's not uncommon to find a window frame or sill suffering from dry rot. Ironically this condition is not caused by the wood being dry, but rather, wet, usually for an extended period of time. In this case the water entered through a joint between the window frame and the exterior shingles -- a place where the caulk had failed. This kind of repair is made by first removing the rotten wood, hardening any adjacent surfaces that may have been affected and then filling the void, in this case, with solid wood and a filler called polyester resin. The resulting repair is durable, practically invisible and costs a small fraction of a window replacement. Just be sure to correct the source of the problem.