Generally, there is no right way to break the news to your children that you and your spouse are getting a divorce. Every family is different and children of different ages will have different levels of understanding the impending changes. In addition, the reasons for the divorce vary greatly from family to family and it may or may not be appropriate to share these reasons with the children. The important thing is to make sure that the children understand that the divorce will change nothing about each parent's love for them.
Depending on how old your children are, it may help them to understand how the divorce will impact their lives on a daily basis. For example, they may want to know how often they will see each parent, where each parent will live, who will take them to school and extracurricular activities. If one parent is moving out while the other remains in the marital home, it may be helpful for the moving parent to take the children to see his/her new home (if one has been selected), or for the age appropriate children to accompany that parent in looking for a new home.
No matter how you decide to tell your children, be careful to not let the conversation turn into finger pointing or negativity toward your spouse. In a divorce involving children, the spouses will have to be a part of each other's lives whether they like it or not, so it is best to limit the hostility wherever possible.
For a comical example of how not to tell your children that you are divorcing, watch this video.