Fracture, infection, or tumors are always a possibility with sudden onset of low back pain. The doctor will look for risk factors that raise the suspicion of a more serious problem.
For example a previous history of cancer such as breast, lung, or colon cancer increases the concern over new onset of back pain. The doctor will also take into consideration red flags such as age over 50, constant pain, and elevated sed rate (lab test).
Most of the time the doctor can tell by the patient's history and clinical presentation what's going on. The doctor looks at what makes the pain or symptoms better or worse. Herniated discs present one way and spinal stenosis another. Back pain from a mechanical or nonspecific origin looks different from either of these problems.
The diagnosis is often confirmed by time. If the patient gets better with the prescribed treatment, then no further tests are ordered. But if the patient doesn't get better with conservative care or gets worse, then X-rays or other imaging tests may be needed.