Firstly, let me state that I am very sorry to hear that something like this happened, and my heart goes out to the child's family and your entire community.
There isn't much you can say to the parents and family other than being there for them in their time of need. Obviously you are very disturbed by this as well, as anyone would be, and often times without even knowing it, by being there for them you are also comforting yourself.
The only thing I pray does not happen is commentary from what I like to call pseudo-neviim. It is human nature to try to find "reasons" for a tragedy. We all do it to some extent. However the pseudo-neviim are those who have no problem claiming to know for certain the reasoning behind G-d's actions. They'll assign the blame to "tznius" or to "talking in shul" or perhaps "the internet."
To claim to know the reasons behind G-d's actions is nothing short of pure heresy. We are simple human beings and we can not comprehend the reasons things happen. We are not capable of that. For people or groups to hijack such situations to further their cause-du-jour is appalling. In our religion we do not give credence to false prophets and that is precisely what people like that are. Their explanations will not help you, they will not help the child's family, your neighborhood, or the pure soul of the child.
My advice for you is not to try and explain this, but to simply be a caring neighbor for this family and for your community to come together, ignore the commentary and proselytizing and grieve together as a family.
May G-d bless you with the strength and courage to pull through this terrible tragedy together with the boy's family and may you never again know of such sorrow.