Particle Acceleration on the Sun and in the Heliosphere