Bad things do indeed happen to good people. The only way I can get round this in my head is the idea of reincarnation. The idea that we choose our life, our families and that we have themes which we have committed to experience for growth and spiritual discovery. How this stands with manifesting and creating our own reality I can only guess . Perhaps we are have a blue print for life but within that theme we are experiencing we have choices and can use the energy to get closer to source.