Your dog is probably vomiting because it has eaten something that is not agreeing with it's stomach, and the lethargy is because the vomiting is making it dehydrated.
If the vomiting starts again, go to the vet as it could be something much more serious like a toxic substance that the dog has swallowed. Make sure you keep the dog well hydrated till you are able to take it to the vet.