Sounds like a clogged anal gland to me. It's very common in dogs, and when the gland releases, boy oh boy what a smell.
This gland usually produces a secretion whenever they poo, but at times, it can get clogged, infected, and gross.
It's really not hard to unclog the gland, but it's not fun, and you will probably vomit.
A vet can do this for you which is your best bet first time around. Also, it's best to have the vet confirm that this is indeed what is wrong with your dog.
I've posted a link with some info, and a step by step instruction guide on how to express anal glands, but once again, I must reiterate, plese see your vet first.
Dog grooming for dummies - Google Book Search
Good luck.