What could the ball of cloud I saw be? I wish I had a picture of this thing I saw, and I did try to video it, but then they hurtled very quickly out of sight. 

Anyway, I will try to explain. . . 

You know when you're up in a plane in the sky, you can see clouds in 'individual' balls? Well, it was about to rain yesterday and the sky was dark. Then suddenly I could see something like a very big, dirty, semi-transparent ball of cotton wool-like cloud hurtling towards me and over my roof. Then another, and then another. By the time I ran outside to try and video them, I could only see one very far off and it was going in a different direction.

The thing about it was that it wasn't like the entire mass of clouds moving across the sky, but it was like balls of clouds or gas, and they were just stumbling across the sky like they had been detached and blown away. And they were not looking nice or anything, but like a pocket of bad gas or something.

I have very little knowledge of science and I wonder if anyone is familiar with and can tell me what I saw?
It's hard to visualize exactly what you saw, but typically in convective clouds, there is such significant motion that oftentimes very chaotic and varying cloud shapes will develop as a result, and they may move quite quickly due to the strong winds.  It appears the term pannus may be used for these, though I'm more familiar with calling them scud.  You mentioned rain, it's northern hemisphere summer, so these cumulus-convection byproducts sounds quite likely.

Around other storm chasers/meteorologists, I've also heard these types of clouds called debris clouds... which is a rather apropos description given that such clouds are often leftovers from earlier storm evolution (perhaps even remnants of old wall clouds if in a situation with supercells)... but using that term might bring confusion to others because tornado debris can also be called a debris cloud.  This page appears to exemplify the confusion, as the picture appears to include remnant clouds from earlier storms in the foreground while the description gives the tornadic definition.  So we probably should avoid this term.

There's no bad gas in thunderstorms... what you see in meteorological clouds is liquid or ice water (all clouds form around tiny bits of dust and such, but this wouldn't affect appearance).  Occasionally smoke or such may be ingested in a cloud, but even in situations where large fires and volcanic eruptions produce clouds, the forced moist updraft region will often look quite similar to a typical cumulus cloud.