Photoionization in gases and photoelectric emission from solids