A study of electron penetration in solids using a direct Monte Carlo approach