Viserys and Daenerys are the last known descendants of a noble Valyrian family called the Targaryens. Like many noble Valyrian families, they had very strong ties to dragons. They bred them, trained them, and rode them to war. In fact, the Targaryen coat of arms is a red three headed dragon on a field of black. When Valyria was destroyed in a mysterious event known as the Doom of Valyria, the Targaryens escaped to Westeros where it became apparent to them that they were the only people there who had access to dragons. Using that technological edge, Aegon the Conqueror invaded Westeros with his dragons and united the Seven Kingdoms into one, effectively beginning the royal Valyrian dynasty in Westeros.
For many years after, the Targaryens continued to use their dragons. At one time, each Targaryen noble would be given a dragon egg from birth hoping that eventually it would hatch and be that Targaryen's war mount. But as years went on, the dragons stopped hatching and those that did hatch were sick and weak. Eventually, dragons would disappear completely. As a result, the Targaryen family lost it's technological edge and it wasn't long until they were supplanted by the Baratheons who are in control of the Iron Throne at the begning of the series.
The relationship between the Targaryens and their dragons are obviously magical, but it is not well understood at this time. But what is obvious is that not all the Targaryens are the same. Even the famed Targaryen look (silver blonde hair and purple eyes) is not uniform among them. So it would seem that Daenerys simply inherited something that Viserys didn't. Or perhaps the dragon eggs themselves gave her something that it didn't to Viserys. It's all speculation at this point.