There are many problems with applying ethical duties to future generations.
Firstly, as Hans Jonas argues Kantian ethics cannot impose on us a duty to continue the human race since the future human race do yet exist, duties to them must, therefore, be contingent on their existence. Yet this does not tally with our intuition, as is rightly examined in the other answer, to most realists, we are driven by our DNA to at least procure a future generation. Any ethic not including this fact relies instead on an act of faith (such as religion), and whilst a perfectly valid position, is not something that can be examined rationally, so I will limit the rest of the answer to broadly materialist approaches.
To escape this problem the simplest solution is to oblige us a duty to continue the human race, thus resulting from that duty, we can presume they will exist and so their existence is no longer contingent, some authors such a Annette Baier consider this to be an acceptable solution given that the will to procure a future to mankind is not under threat, but Jonas still considers it too weak to represent our moral imperative because it would exclude from responsibility those that have chosen not to have children. This is one of the central problems with Kant with regards to future generations. The choice to have children or not cannot be universalized (it is perfectly acceptable for some people to not have children, but it would not be acceptable for such a principle to become universal without removing Baier's duty and so eliminating any moral responsibility to the future generations).
Consequensialist ethics is clearer in that if we presume that at least some people are yet to exist then our actions now will have a consequence on their well-being. The problem here, however, as Parfit points out, is that so many factors have to come together to lead to a particular person being born that we cannot say that such a person's existence would have been worse/better as a consequence of our actions, they may well have simply never existed. The further into the future one looks the greater the effect of this uncertainty. This can be rescued, however, at least in intent, by presuming that if we are to maximise happiness, the existence of an infinitely continuing generation of relatively happy people will always outweigh the happiness any finite current generation. Whilst this could lead to the conclusion that we should make our lives a misery even for the slightest happiness of all future generations, this is only a problem if such a choice was ever likely to naturally arise.
This is where the principle of Natural Law becomes more attractive. We can examine such utilitarian decisions in relative safety because it is extremely unlikely that conditions would exist whereby preserving the well-being of future generation would ever come at the expense of our own well-being as this would be contrary to evolution. This, to me seems like the most appealing solution to the problem.
In summary, we can say that we do have a moral obligation to the future generation by any form of consequensialist ethics on the grounds that such a population will almost certainly exist. Our responsibility diminishes the further into the future we look as our ability to accurately judge the consequences of our action diminishes also. We need not concern ourselves with the false dilemmas of the infinite size of the potential future generations because the world in which such decisions take place is one in which our well-being is already tied to the well-being of a future generation and so there are unlikely to be any real conflicts.