The evaluation of the elemental composition of the crust of solar system objects (planets, asteroids and moons) represents an important clue to understand the formation of the solar system. A number of missions are planned in the coming years to measure the fluorescence spectra of Solar System objects, as a method to ascertain their composition. A Geant4-based application for the simulation of X-ray emission spectra from rock samples is presented. The application is based on Geant4 Atomic Relaxation package, which provides accurate models for X-Ray fluorescence emission. This application demonstrates Geant4 capabilities to generate the fluorescent spectra resulting from complex materials, such as geological samples. The simulation has been validated with comparisons to experimental data taken at Bessy by a team of the European Space Agency (ESA), exposing several rock samples of astrophysical interest (anorthosite, hematite, dolerite, gabbro, obsidian, basalt, Mars-stimulants, etc.). The simulation development, accurately validated by experimental results, has open the possibility to create a library of simulated rock spectra, to be used as a reference in the studies of several planetary missions, such as Smart-1, BepiColombo (Mercury) and Venus Express.