Get your dog to the Vet immediately. Could be many things a lot of them fatal.
My dog was doing the same thing and she had a trachea infection. Either way its going to cost you money.