There can be other causes too, such as side effects of medication.
I'm very glad I read up on potential side effects of a pain medication I'm on. When I upped a dose (at the suggestion of a GP) I began having really weird thoughts, seeing ways to kill myself everywhere and feeling really detached from things. It wasn't a very pleasant experience, especially being home alone, and needless to say, I dropped the meds down some for a bit to up the dose more gradually.
I also think conditions like depression can trigger strange thoughts and at times overwhelming desperation, desolation etc... can lead to some dark thoughts.
Whoever your question relates to, someone having suicidal thoughts could speak to their GP or The Samaritans for support and how to get help and A&E units will usually have a mental health team (or via out of hours doctors) on call to help so there is someone there whenever you need one.