See I think it is genetic because there are benders, but then there are those within a family of benders who cannot bend. For example (which I just realized others are saying too sweatdrop ), in the episode with Aunt Woo, the cloud-reading fortune teller, Aang is hastily making a barrier to protect the village from the volcano lava and requests help from any earthbenders. Twin brothers pop up and one says they can bend, the other says that he cannot. So I think it's right to guess that bending is like any other genetic attribute, just like hair color, height, body type, etc.
I think for cases such as Katara, her Gran-gran came from the north pole which did have benders. The bending gene simply skipped a generation and went to Katara. As for Toph, I think her dad was an earthbender so she just received the bending gene.
This is my theory any ways.
Additionally, in the new series, Legend of Korra, Tenzin's wife is pregnant with their fourth child and says to Katara that she hopes it's not another bender and is normal like her. So this also makes me think it's genetic.