Incontinence is fairly common in the middle-aged spayed female dog. Incontinence refers to the loss of tone or integrity of the external urethral sphincter, the ring of muscle that helps you hold urine in your bladder.
There are several theories about why this would happen. One is that due to the spay surgery, which in dogs involves removal of the uterus and ovaries, there is a subsequent lack of production of the female hormones that would normally stimulate the external urethral sphincter.
Another theory has to do with the spay surgery itself. During the surgery, the uterus is pulled right out of the dog's body. It's easier to do surgery outside of the body, where you can see what's going on, then in the darkened cavern inside the abdominal cavity. This necessitates, in some cases, a lot of traction (i.e. pulling) on the uterus, which is attached to the cervix, which is attached (in dogs) to the vestibule, which is also where the urethra empties into from the bladder. Once you stretch the cervix, you've also indirectly stretched the urethra, and have possibly disrupted the integrity of the urethral sphincter.
A third option is a chiropractic lesion or subluxation. During the spay surgery the dog is lying on her back, her spine is extended past the normal limits, her rear limbs are splayed - also unnaturally - in order to facilitate the surgical approach. When you're under anesthesia, you don't have the muscle tone that would normally prevent your joints from moving beyond their normal range. If the joints in the spine are disrupted, blood supply to the nerves that are coming out of the spinal cord and going to the various organs can be compromised. This also explains why incontinence can also be seen in dogs that have hip or lumbar spine degeneration or arthritis.
Incontinence has to be differentiated from other conditions such as urinary tract infections or diabetes, that will cause the dogs to have to urinate a lot more frequently. Even if the dog is leaking urine all over her bed at night, it is still necessary to test the urine (and blood tests are a good idea as well) to make sure there is not some underlying cause for the condition.
The conventional treatments include drugs such as DES and Proin. DES (diethylstilbestrol) is a synthetic estrogen that supposedly would replace the loss resulting from the spay. Unfortunately, this drug also has the potential side effect of causing irreversible aplastic anemia (i.e. it can wipe out your bone marrow forever), and I'm always surprised when I see it still in use after all these years.
Proin (phenylpropanolamine) is a drug that increases the tone of the external urethral sphincter. It's not known exactly why or how it does this. This drug was pulled off the human market because it caused heart disease in people, and in dogs it can cause irritability, increased heart rate, hypertension, and other side effects. Sometimes it works, sometimes it doesn't. Some dogs will do well at a lower dose than is recommended. Some can be weaned off it after treating them for 3-4 months to "retrain" the muscle.
My recommendations for incontinence include: natural diet (some cases are actually due to a gluten or grain allergy, and will resolve when these are removed from the diet), healthy basic supplements to balance the system, spinal manipulation (if the problem is a chiropractic subluxation, restoring blood supply to the nerves will fix it), and specific, individualized homeopathic treatment.