It can be caused by the fish bumping into things, usually the glass. It can also be the start of a bacterial infection. Monitor the fish over the next 24 hours and see if it gets worse. If it goes white and looks inflamed then it could be Columnaris and will need treating with an anti-bacterial medication ASAP. If it doesn't change over the next couple of days then it is probably just a bruise and should go down by itself in a week or so.
Doing a partial (30-50%) water change and complete gravel clean can help prevent the bump becoming infected. Also make sure the filter is clean and working correctly. If you have to treat the tank then remove any carbon from the filter before you treat.